Totally Zenned
- Join Date:
- Oct 2004
- Location:
- Southport, UK
- Posts:
- 3,644
- Plugin Contributions:
- 6
HOW TO: Combine Manufacturer and Model field info in product listings
With a fixed width site, there can be a shortage of space in the product listings. One thing you can do, if relevant to you and assuming you need to display the information, is to combine the Manufacturer and Model info so that you can hide one column from the table. The way I've done this doesn't entirely remove the column, but at least sets it to a minimum width, thereby giving more space for the description. I guess the column could be removed, but that requires programming outside my skill level.
Before going any further, take a look at http://www.fastlec.co.uk/index.php?main_page=index&cPath=22_24_83 to see if that layout suits your needs.
I take no responsibility if this wrecks your cart, but you are working with an override so you should be safe.
Edit includes/modules/product_listing.php. Find at around line 24
case 'PRODUCT_LIST_MODEL':
$lc_text = TABLE_HEADING_MODEL;
$lc_align = '';
$zc_col_count_description++;
and, to hide the column heading for Model, change to
case 'PRODUCT_LIST_MODEL':
$lc_text = '';//TABLE_HEADING_MODEL;
//$lc_align = '';
//$zc_col_count_description++;
Then at around line 104 find
case 'PRODUCT_LIST_MANUFACTURER':
$lc_align = '';
$lc_text = '<a href="' . zen_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing->fields['manufacturers_id']) . '">' . $listing->fields['manufacturers_name'] . '</a>';
break;
and change to
case 'PRODUCT_LIST_MANUFACTURER':
$lc_align = '';
$lc_text = '<a href="' . zen_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing->fields['manufacturers_id']) . '">' . $listing->fields['manufacturers_name'] . '</a><br />'.$listing->fields['products_model'];
break;
I appreciate that this may not be the best way to do it, but it works for me - although it would be nice to remove the column completely AND get rid of the sort sign as well.
Save the file as includes/modules/YOUR_TEMPLATE/product_listing.php
Development Manager @ JSWeb Ltd - suppliers of Applepay/Googlepay for Zencart
20 years with Zencart !