***************************************************************************************************************
Description in Product Listing Hack v.2 (based on the 9/1 snapshot) released under the GPL (see license.txt)
(Original mod by John Poynton <admin@stickyweb.com.au>)
Please report any bugs, suggestions, etc. to Paul Crovella <paul_crovella@myrealbox.com>
***************************************************************************************************************

This mod displays a truncated product description in the product listing underneath any other info you've decided to show there (manufacturer, price, model, etc.) with the exception of the product image. The product image will span both rows if it and the description are both present. The settings for all of this can be found (once you've ran the SQL queries at the end of this page) under admin>configuration>Product Listing. To disable the product description just set it at 0 and to enable it set it to the far right of anything else you've enabled for the product listing (99 should do it). If you use the product image as well, make sure the image is set to either the far left (1) or just before the product description, anything else will break the displayed tables. (Sorry, some limitations just can't currently be overcome.)

Note that the displayed description is truncated. Set the number of characters in the admin (same place mentioned above). It'll display at most however many characters you tell it to in the admin, but instead of splitting up a word it will backtrack until it finds a space character to truncate the description at. All html is stripped out (except for the following tags: <a><b><em><font><i><s><span><strong><sub><sup><u>) to make sure block level elements do not completely destroy the product listing. And finally, an ellipses (...) is added to the end of the description if part of the description was actually cut off.
 

The following files were modified. You should be able to just overwrite your existing copies with the ones included in this zip unless you've already made changes to these files. Regardless, I highly recommend making the code changes by hand (using a file comparison tool such as Beyond Compare or WinMerge will assist in this immensely). And as always, BACK UP YOUR FILES FIRST!

catalog/advanced_search_result.php
catalog/default.php
catalog/includes/classes/boxes.php
catalog/includes/functions/general.php
catalog/includes/modules/product_listing.php (removed colspan="<?php echo $colspan; ?>" from td tags as well)


Run the following two SQL queries on your database:

The first is to enable the display of Products Description in the Listing 0 = No 99 = Yes
INSERT INTO `configuration` (`configuration_id`, `configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES ('', 'Display Product Description', 'PRODUCT_LIST_DESCRIPTION', '99', 'Set to 0 to disable, set to 99 to enable.', '8', '11', '', '', NULL, NULL); 

The second defines the number of characters to display before truncating the description
INSERT INTO `configuration` (`configuration_id`, `configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES ('', 'Length of Truncated Product Description', 'PRODUCT_LIST_DESCRIPTION_LENGTH', '350', 'How many characters would you like to display? ', '8', '12', '2002-03-16 18:51:26', '2002-03-16 18:51:26', NULL, NULL);  