Results 1 to 8 of 8
  1. #1
    Join Date
    Jan 2007
    Posts
    6
    Plugin Contributions
    0

    Default Display Product Description - truncate issue

    Hi - new to Zen Cart and having some challenges.

    I want to display more than 80 characters in the various Listings (Products Listing, Featured Listing, etc.).

    It seems this is controlled here:

    Admin>Configuration>Product Listing>Display Product Description

    If I edit this field, it works, but only up to 80 characters. So if I set it at 40 characters, 40 will show in the Product Listings, Featured Listings, etc. If I set it at 60 or 80, all works like it should. However, anything over 80 doesn't work - it will stop at 80 characters.

    Any thoughts.

    Thanks.

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

    Default Re: Display Product Description - truncate issue

    Have you an URL where this is happening?

    I can go to 150, 500, 20, etc. just changing the setting in:
    Configuration ... Product Listing ...
    Display Product Description
    Do you want to display the Product Description?

    0= OFF
    150= Suggested Length, or enter the maximum number of characters to display
    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
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Display Product Description - truncate issue

    Note: on New, Featured and All Listing there is not a switch for this ... how did I miss that?!

    This is hard coded at the moment, for example the Featured Listing:
    tpl_modules_products_featured_listing.php

    Has the code at approximately line 113:
    PHP Code:
            $display_products_description stripslashes(zen_trunc_string($disp_text150'<a href="' zen_href_link(zen_get_info_page($featured_products->fields['products_id']), 'cPath=' zen_get_generated_category_path_rev($featured_products->fields['master_categories_id']) . '&products_id=' $featured_products->fields['products_id']) . '"> ' MORE_INFO_TEXT '</a>')); 
    The 150 sets the length ...

    This should be fixed in one of the upcoming releases to allow you to set the length yourself ...

    If one were to assume that the code would change so that the setting in Featured Listing where it reads:
    Display Product Description
    Do you want to display the Product Description - First 150 characters?
    Would change from 0 or 1 to mean on or off and get 150 characters to be how many where 0 is OFF and any value is the number of characters ... this would be the change made ...

    Cannot believe I goobered up a setting like that ...
    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!

  4. #4
    Join Date
    Jan 2007
    Posts
    6
    Plugin Contributions
    0

    Default Re: Display Product Description - truncate issue

    Ajeh,

    Thanks for the advice. Something is still amiss, though.

    I went to "tpl_modules_products_all_listing.php" in my template directory. I found the line you refered to and changed the number from 150 to 50. That effectively reduced the number of characters displaying on the listing for each product to 50. However, when I set it to anything over 80 (e.g. 90), it still truncates at 80.

    I purchased this template and am modifying it. Perhaps whomever originally built it changed something somewhere. I just don't know where to look.

    Here's the URL of the All Products listing:

    http://www.orthopedicapothecary.com/...e=products_all

    Let me know if you have any further ideas.


    Thanks.

    ** EDITED *** Never ever post in a forum, email, newsletter etc. the zenid or zenAdminID or you will be doomed!!
    Last edited by Ajeh; 1 Apr 2007 at 03:06 PM.

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

    Default Re: Display Product Description - truncate issue

    This is really kind of weird ...

    You may need to search further to see if something is further truncating the description beyond the setting ...

    The function zen_get_products_description gets the description ... might look for that and see if it is doing something else with it ...

    The function zen_trunc_string is what is using the paramater of the size to shrink it ...
    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!

  6. #6
    Join Date
    Jan 2007
    Posts
    6
    Plugin Contributions
    0

    Default Re: Display Product Description - truncate issue

    First - thanks for the EDIT above on the hyperlink.

    Next - I figured it out - at least for the most part.

    Here's the breakdown of the issue and how I found my way to it in case others have similar problems. I'm by no means a programmer, so forgive me if I mis-use any terms.

    - First, I changed the template from the one I purchased (e.g My-Template) to the Classic one. All then worked the way it was supposed to under Classic. Thus, I concluded it was something specific to how my template had been built.

    - I then started comparing files between the Classic and My-Template. I found that My-Template included a bunch of $tm_ references including "$tm_desc = $display_products_description;"

    - I somehow found my way to a file in "My-Template/common/" called "tpl_tmfuncs.php". Upon examining it, I found 3 references to "80" which was my truncation limit. I changed them all to 500 and discovered that this was indeed the issue.

    Now I just need to figure out if I really needed to change all 3 instances of "80" and if that will mess anything else up.

    Finally, in doing some further forum searches, it seems that purchasing templates (namely one from Template Monster), can get you more than you bargained for. I guess at times the template designers take liberties with the code just to get it to look suitable for sale. I'm not sure if this is one of those or not, but this sure took some time out of my life to figure out.

    Thanks again for steering me in the right direction.

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

    Default Re: Display Product Description - truncate issue

    For the next release I replaced all the original 150 settings with constants that are now in the database table:
    PRODUCT_NEW_LIST_DESCRIPTION
    PRODUCT_FEATURED_LIST_DESCRIPTION
    PRODUCT_ALL_LIST_DESCRIPTION

    Change the configuration_value to the size you want in your database, for now, and use those constants in place of the 150 in their appropriate files ...

    On the next upgrade, they should have the text and the size will be a fill-in ...
    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!

  8. #8
    Join Date
    Apr 2007
    Posts
    13
    Plugin Contributions
    0

    Default Re: Display Product Description - truncate issue

    I'm having the same problem as the OP, and I've tried both of the suggestions given here and it's still not working. Is there any new information on how to fix this problem? You can see my site at www.minglewoodsolutions.com , and you'll see on the main page under "featured products" we only get three words for the description. VERY frustrating!! ANY help would be wonderful and greatly appreciated.

 

 

Similar Threads

  1. v151 Display Subcategory Description - depth issue
    By simon1066 in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 8 Nov 2013, 09:32 AM
  2. Truncate product names to 1 line
    By I.Q in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 17 Sep 2010, 11:12 PM
  3. Symbols truncate Product Name and Description after editing
    By Sprainbrook in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 5 Mar 2010, 03:59 AM
  4. Can You Truncate Product Names?
    By pensive612 in forum Templates, Stylesheets, Page Layout
    Replies: 13
    Last Post: 8 Nov 2008, 04:52 PM
  5. Weird Product Description Issue
    By bennettelec in forum Setting Up Categories, Products, Attributes
    Replies: 3
    Last Post: 7 Apr 2008, 08:40 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