Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2004
    Location
    Nevada City, CA
    Posts
    115
    Plugin Contributions
    0

    html links in product description (on listing page)

    Hello,

    I'd like to be able to have a link in the product description for some of my products, that appears on the product listing page.

    The display of the description occurs on line 122 of modules/product_listing.php:
    PHP Code:
    $lc_text '<h3 class="itemTitle"><a href="' zen_href_link(zen_get_info_page($listing->fields['products_id']), ($cPath 'cPath=' $cPath '&' '') . '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($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . '</div>'
    I've tried removing the zen_clean_html function so that it looked like so,
    PHP Code:
    $lc_text '<h3 class="itemTitle"><a href="' zen_href_link(zen_get_info_page($listing->fields['products_id']), ($cPath 'cPath=' $cPath '&' '') . 'products_id=' $listing->fields['products_id']) . '">' $listing->fields['products_name'] . '</a></h3><div class="listingDescription">' zen_trunc_string(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id'])), PRODUCT_LIST_DESCRIPTION) . '</div>'
    but it broke the display, cutting off output right after <div class="listingDescription">.

    I'm probably going about this the hard way (as usual!), so if anyone knows a way to keep links in the truncated description, please respond

    David

  2. #2
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    20,958
    Plugin Contributions
    25

    Default Re: html links in product description (on listing page)

    Huh - looks like it ought to work. You seem to have removed the correct extra close parenthesis....

    What I did to edit this was just comment it out ...zen_trunc_string(/*zen_clean_html*/(stripslashes... and not touch any parentheses. Maybe that will work for you too?

  3. #3
    Join Date
    Jul 2004
    Location
    Nevada City, CA
    Posts
    115
    Plugin Contributions
    0

    Default Re: html links in product description (on listing page)

    Quote Originally Posted by gjh42
    Huh - looks like it ought to work. You seem to have removed the correct extra close parenthesis....

    What I did to edit this was just comment it out ...zen_trunc_string(/*zen_clean_html*/(stripslashes... and not touch any parentheses. Maybe that will work for you too?
    It turns out that either removing the zen_clean_html and associated parends or doing it your way will work.

    What was happening with me was that the previous product had a table in the first part of the description, which was being truncated after 150 characters, and voila, messed up layout.

    So, no more tables in the first 150 characters of description!

    Thanks for the response

 

 

Similar Threads

  1. Product Listing - Move description v1.2.6
    By patski in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 1 Jun 2006, 11:54 PM
  2. add to card error for listing all product page
    By OZ_Jack in forum General Questions
    Replies: 2
    Last Post: 1 Jun 2006, 04:32 PM

Bookmarks

Posting Permissions

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