First of all, this is for ZC version 1.3.8. There may be some differences in earlier versions.
On the All Products page, when a product's description is truncated (does not all display because it's too long), a More Info link appears at the end of the description. For some reason, the Product Listing page was not coded this way. Instead, all you get is an ellipse at the end of the truncated description, which isn't enough for the unobservant shopper.
I found solutions that would add the link to the product listing description, but all the ones I found add the link regardless of whether or not the description is truncated, in other words, even when there actually is no other information to go see.
Upon taking a look at how the link code works on the All Products page, I managed to get it to work properly on the Product Listing page, appearing only when it should. I figured that others might want to do this as well, so here are the instructions.
You'll be changing one file: product_listing.php. If you have made no previous alterations to that file, look for it in /includes/modules/. Once you've made the changes, put it in /includes/modules/your_template/. Do not apply the changes to the default file.
In the above file, find the following code (within lines 98 and 100 if no previous changes have been made to the file):
Code:
<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>';
Replace with:
Code:
<div class="listingDescription">' . zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION, ' <a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>') . '</div>';
IMPORTANT: There are two places in the file that have this code. Be sure to change both.
And that's it. You should now get a more info link after every truncated description on the Product Listing page but not when the description is all there, just like you do on the All Products page.
Be aware that if a product has attributes, there will now be two 'more info' links, the one at the end of the description and the one in the usual spot in place of the Buy Now or Add to Cart button.
Bookmarks