Forums / Templates, Stylesheets, Page Layout / Product descriptions styles display strange

Product descriptions styles display strange

Locked

Views: 3,339

Results 1 to 17 of 17
This thread is locked. New replies are disabled.
12 Jan 2008, 11:31 PM
#1
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Product descriptions styles display strange

My client is inisiting on using a specal styling for some of the text in the product descriptions.

Basically he wanted the first two letters of the product name a different color than the rest of the product name. So I made some changes to the stylesheet to help support this styling. That part works fine, and it displays perfectly on the product detail pages.

However, when viewing one of the product listings (like the All Products listing), there is a strange whitespace that appears in the product description between the first two letters of the product name and the rest of the product name.

So product names appear like this: ph resh relaxed™

Instead of: phresh relaxed™

Does ANYONE have a clue why this happens and how to correct it??

Here's link to one of the products with the styling I am referring to:
http://clients.overthehillweb.com/phlaunthair/phflauntshop/index.php?main_page=product_info&cPath=1&products_id=1

Here's the link to the All Products page:
http://clients.overthehillweb.com/phlaunthair/phflauntshop/index.php?main_page=products_all

My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

12 Jan 2008, 11:51 PM
#2
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Product descriptions styles display strange

I don't know if this is related to the problem, but it is clumsy HTML and ought to be redone in any case:```html

<!--bof Product description --> <div id="productDescription" class="productGeneral biggerText"><p><span class="letters_color"><span class="productTitle_space">ph</span></span><span class="productTitle_space">resh relaxed™</span><br /> Texturized indian hair closely resembles newly relaxed African American hair. <span class="letters_color"><span class="letters_space">ph</span></span><span class="letters_space">resh relaxed™</span> is excellent for those who wear straight styles but prefer hair that is slightly coarse in texture.</p></div> <!--eof Product description -->
```html
<span class="letters_color"><span class="productTitle_space">ph</span></span><span class="productTitle_space">resh relaxed™</span>

would be better as

<span class="productTitle_space"><span class="letters_color">ph</span>resh relaxed™</span>
13 Jan 2008, 2:22 AM
#3
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Product descriptions styles display strange

Actually the WSIWYG editor is doing this.. Not sure how to fix that either.. It might have to do with the order in which you apply the styles in the WYSIWYG editor.. I'll have to play around with it to confirm this.. Unfortunately, I need a WYSIWYG editor to make it easier on the client to create products with this crazy text styling he wants since he is HTML challenged..

In any case the awkward HTML is not related to the issue.. Even if I correct the HTML, I still have the mysterious whitespace showing..

My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

13 Jan 2008, 2:29 AM
#4
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Product descriptions styles display strange

I suspected it was an editor doing that, since it would be so much more work to code it wrong by hand... :) Too bad that wasn't it though.
It's definitely odd - there is apparently an actual space character being inserted when the HTML is stripped for the listing display. I suppose something about the zen_clean_html() function must be doing it, though I have no idea what or why.

13 Jan 2008, 2:37 AM
#5
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Product descriptions styles display strange

Yeah.. too bad that didn't do it.. I was so hopeful that it was a SIMPLE solution alas only to have my hopes dashed..:(

and I figured out HOW the editor is generating this awkward HTML.. It is definitely the order in which you apply the styles in the WYSIWYG editor which determines how clean the code that the editor generates will be.. I'll have to make sure I DRILL into my client's head the EXACT procedure to avoid that..:laugh:

In the meantime I am damn puzzled as to why this whitespace appears.. Got any sage advice for me oh wise one???

My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

15 Jan 2008, 6:04 AM
#6
rwoody avatar

rwoody

Totally Zenned

Join Date:
Aug 2004
Location:
Fountain Hills, AZ
Posts:
476
Plugin Contributions:
0

Re: Product descriptions styles display strange

In order to display html in product listing you need to edit your modules/productListing.php and remove the clean html from the code -

around line 99 find the following

class="listingDescription">' . zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . '</div>' ; 

Change it to:

class="listingDescription">' . zen_trunc_string(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id'])), PRODUCT_LIST_DESCRIPTION) . '</div>' ; 

Making that change will allow your html to show up in the product listing as well as the product detail.

Hope that helps

Ruth

15 Jan 2008, 8:36 AM
#7
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Product descriptions styles display strange

Bless you!!! :clap:I was getting ready to go to plan "B".. One question.. I need to create an override for this file right??

My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

15 Jan 2008, 10:06 AM
#8
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Product descriptions styles display strange

Correct. Make it /includes/modules/your_template/product_listing.php.

You also need to set the product listing description length, as described in the Matching product_info_display and product_listing thread, post 2.

18 Jan 2008, 2:56 AM
#9
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Product descriptions styles display strange

gjh42:

Correct. Make it /includes/modules/your_template/product_listing.php. Excellent! Thanks for the info.. As usual you are one of my Zen heros!:clap:

gjh42:

You also need to set the product listing description length, as described in the Matching product_info_display and product_listing thread, post 2.

I read this thread.. One question.. I only need to do this is I want the entire product description to appear in the product listings right??

My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

18 Jan 2008, 6:07 PM
#10
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Product descriptions styles display strange

If you truncate the description at all, you will lose any closing tags that happen after the cutoff.
This could cause errors, so you would have to be very careful that you never have any HTML tags that open before the cutoff point and close after it.

There are ways (without new fields and database coding) to get different descriptions in listing and info pages. Look at cutting product descriptions manually (for listings) and Customizing Product Description Text Formatting on Category Page, for examples.

20 Jan 2008, 8:49 AM
#11
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Product descriptions styles display strange

gjh42:

If you truncate the description at all, you will lose any closing tags that happen after the cutoff.

This could cause errors, so you would have to be very careful that you never have any HTML tags that open before the cutoff point and close after it.

There are ways (without new fields and database coding) to get different descriptions in listing and info pages. Look at cutting product descriptions manually (for listings) and Customizing Product Description Text Formatting on Category Page, for examples.
Wow Glenn as usual you are a FOUNTAIN of GREAT information!:clap:

BUT... :cool:

I think you might have misunderstood my question..:smile: (or my reason for asking it..:smile:)

I actually don't need to modify the way product descriptions appear in the product listing pages for the site I'm working on now... I really just wanted to cleanup the strange behavior that's ocurring in the product listings. (it looks like Zen is leaving a space in place of the end tag for the inline styles in the product description). I don't plan on having too many of these sites with these kinds of inline styling requirements.. (too much drama to get it all working correctly.. :laugh:) I just wanna fix this one site and move on ya know? :smile:

However, the reference links you provided are all bookmarked now.. Gives me more options for the product descriptions in the product listings.. Good stuff for future use... Thanks again for your help! :smile:

My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

20 Jan 2008, 6:34 PM
#12
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Product descriptions styles display strange

I understood your original question; I was just following up on the "enable html" post, which wasn't what you wanted to do.

Unfortunately, I can't see any reason why that space should be showing up in the (html stripped) listing descriptions.

21 Jan 2008, 7:23 AM
#13
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Product descriptions styles display strange

gjh42:

I understood your original question; I was just following up on the "enable html" post, which wasn't what you wanted to do..And I DO appreciate your more than thorough answer to my question.. It's kinda why I seek out your posts here when I'm looking for answers.. You always give such COMPLETE information!:smile:

gjh42:

Unfortunately, I can't see any reason why that space should be showing up in the (html stripped) listing descriptions.I know.. maddening isn't it.. Though I haven't done it yet, I'm confident that commenting out the html_clean elements should resolve my immediate issue.. Plus.. I'm making a note to self to discourage future clients from using inline styles in product descriptions.. :laugh:

My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

27 Jan 2008, 6:28 PM
#14
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Product descriptions styles display strange

** Deleted **

Gotta go back and re-read Glenn's other suggestions..

puts on dunce cap and leaves thread

My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

27 Jan 2008, 6:37 PM
#15
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Product descriptions styles display strange

Okay.. So finally got around to fixing this.. It's works great on all the product listing pages..

But

It does NOTHING for the "All Products" page (http://clients.overthehillweb.com/phlaunthair/phflauntshop/index.php?main_page=products_all).. Any suggestions.. I tried looking for "zen_clean_html" using the developers tools, but I don't clearly see anything that makes sense for me to modify.. I could use a little sage guidance again.. :smile:

My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

27 Jan 2008, 7:57 PM
#16
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Product descriptions styles display strange

The all listing page is built differently than the product listing page (older code, I believe).

The place to edit is around line 110 in /includes/templates/your_template/templates/tpl_modules_products_all_listing.php:

      if (PRODUCT_ALL_LIST_DESCRIPTION != '0') {
        $disp_text = zen_get_products_description($products_all->fields['products_id']);
        $disp_text = zen_clean_html($disp_text);
```You can just comment out the line:

//$disp_text = zen_clean_html($disp_text);
27 Jan 2008, 9:15 PM
#17
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Product descriptions styles display strange

gjh42:

The all listing page is built differently than the product listing page (older code, I believe).

The place to edit is around line 110 in /includes/templates/your_template/templates/tpl_modules_products_all_listing.php:

  if (PRODUCT_ALL_LIST_DESCRIPTION != '0') {
    $disp_text = zen_get_products_description($products_all->fields['products_id']);
    $disp_text = zen_clean_html($disp_text);
> 
> //$disp_text = zen_clean_html($disp_text);Thanks for the hand..:yes: My gut instinct was to comment out that line.. I needed to hear it from the experts first.. I went ahead and made the same change to the  tpl_modules_products_new_listing.php & tpl_modules_products_featured_listing.php pages while I was on a roll.. Thanks for the hand.. AGAIN..:smile:

My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.