Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

Add description to general category list display


Recommended Posts

I want to modify the built-in category list display to include description for OSC v. 2.3.1. Right now, it only shows image, product name, price, and buy now button. I do not want to sort by description so just need to know which part of the existing code generates each line in the table.


I can probably track down the variable definitions myself once I am looking at the correct files and code to make sure I get the variables correct.

Link to comment
Share on other sites

OK, I found where to add the information I want on lines 106 and 108 in product_listing.php as noted below:


At the end of the lines I changed ...'</a></td>';

to '</a> - <i>'. $listing['products_description'] .'</i></td>';


I have to populate $listing['products_description'] so need to find where $listing['products_name'] was populated from the database and add the description. I see that $product_info_query is used in catalog/product_info.php and includes the description but need to figure it out for the category list display...

Link to comment
Share on other sites

  • 3 weeks later...

I ended up adding the description by modifying the /catalog/includes/modules/product_listing.php file as I noted above but I simply added the products_description to be retrieved from the database by adding one line before line 13 of existing code:


. . . $listing_split = new splitPageResults($listing_sql, MAX_DISPLAY_SEARCH_RESULTS, 'p.products_id');

The code I added before that above is:


. . . $pieces=explode('select ',$listing_sql);$listing_sql='select pd.products_description, '.$pieces[1]; /* Added */


This may not be the most graceful solution but it populates the $listing['products_description'] variable (I added for lines 106, 108 as noted above) maintaining the same variable name conventions without an additional database query.


Basically, $listing_sql is the variable that contains the list of product information query definitions that will be extracted from the database and I simply added the products_description information (defined on line 45 of catalog/includes/database_tables.php) to the beginning of the list.

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...