Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    Join Date
    Aug 2004
    Location
    Fountain Hills, AZ
    Posts
    515
    Plugin Contributions
    1

    Product Listing Ignoring formatting

    I have very short product listing descriptions but I have specific formatting in html in the description. The listing page totally ignores the formatting, but displays it on the details page. Is there a way to get the listing page to display the formatted text?

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Product Listing Ignoring formatting

    Because the listing truncates the products_description based on length, everything is stripped out as it would make a real mess to cut off the end of the HTML code ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  3. #3
    Join Date
    Aug 2004
    Location
    Fountain Hills, AZ
    Posts
    515
    Plugin Contributions
    1

    Default Re: Product Listing Ignoring formatting

    Ok, I was afraid of that... I need this formatting here... what can I do to fix this?

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Product Listing Ignoring formatting

    You would need to change the code and how it handles the products_description so that it does not truncate any of your text ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  5. #5

    Default Re: Product Listing Ignoring formatting

    Quote Originally Posted by Ajeh View Post
    You would need to change the code and how it handles the products_description so that it does not truncate any of your text ...
    Which code should we be modifying here?

    Is it just a matter of changing a setting so that the entire description shows on the Listing page (which is what I would prefer, in any case)? And, if so, where is that done? (Under Configuration > All Listing > Display Product Description, it says "Do you want to display the Product Description - First 150 characters?"; but I'm not clear on how to turn off the character limit, or if this will even make the HTML render properly?)

    I need line breaks; when the description all runs together it looks really horrible...

    Thanks in advance for your help.

  6. #6
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Product Listing Ignoring formatting

    You would need to customize the:
    /includes/modules/product_listing.php

    Copy that to your templates and overrides directory:
    /includes/modules/your_template_dir/product_listing.php

    Then change the products_description so that it does not alter the HTML that you have nor truncate it ...

    NOTE: this can result in some very long listings as well as issues on the display depending on your HTML in the description ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  7. #7

    Default Re: Product Listing Ignoring formatting

    Yay! That worked! Thank you so much!

    (I was actually on the right track, after reading another thread -- but I was trying to comment out the "zen_clean_html" part, which didn't work because I did not delete the closing parenthesis.)

    Anyway, it looks the way I want it to now.

    Hopefully this won't cause problems elsewhere. (All my descriptions are short, but one never knows . . .)

    Thanks again -- I do appreciate it.

  8. #8
    Join Date
    Nov 2006
    Posts
    2
    Plugin Contributions
    0

    Default Re: Product Listing Ignoring formatting

    can you tell me what changes you made to the product_listing.php because I need a solution for the same problem you have.

  9. #9

    Default Re: Product Listing Ignoring formatting

    Sorry -- I should have posted what lines needed to be changed.

    Please make a backup copy of your "product_listing.php" file, in case I screw something up for you (or as long as you're using a custom/overrides folder you can just delete/replace the custom file if you need to).

    In that file you want to look for "zen_clean_html" (no quotes). It appears in two places -- should be lines 98 and 100.

    In line 98 where it says:

    $lc_text = '<h3 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'products_id=' . $listing->fields['products_id']) . '">' . $listing->fields['products_name'] . '</a></h3><div class="listingDescription">' . zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listi ng->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . '</div>' ;

    you want to remove the "(zen_clean_html" (note the parenthesis at the beginning); then remove one of the three closing parentheses after "['languages_id'])))", so there will be two not three: "['languages_id']))"

    Do the same thing on line 100.

    Let me know if this was unclear at all, or if it doesn't work for you.

  10. #10
    Join Date
    Aug 2004
    Location
    Fountain Hills, AZ
    Posts
    515
    Plugin Contributions
    1

    Default Re: Product Listing Ignoring formatting

    Ah Ha!! I forgot to remove the extra bracket!! I knew it had to be something simple!!!

    Thanks

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v138a IE9 ignoring attributes
    By MaureenT in forum General Questions
    Replies: 0
    Last Post: 3 Mar 2012, 10:38 PM
  2. Description with formatting on Category Listing page
    By vandiermen in forum Templates, Stylesheets, Page Layout
    Replies: 10
    Last Post: 27 Oct 2010, 11:03 AM
  3. Formatting Product Listing
    By frantic in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 25 Mar 2010, 12:37 PM
  4. Trying to change product listing formatting
    By ajt in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 9 Jan 2008, 10:05 PM
  5. Product Listing formatting
    By Elfboy in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 7 Sep 2006, 07:41 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg