New Zenner
- Join Date:
- Sep 2008
- Posts:
- 53
- Plugin Contributions:
- 0
Post #1 by 524cw
I'm trying to show the manufacturers name on my product listing page but it's proving tougher than I thought!
In my admin > configuration > all listing I have Display Product Manufacturer Name set to 2150. So it should be "on". I think!
I'm using Zencart 1.3.9f along with the single listing template mod to show the products in a grid on the product listing page for each category. The relevant code I'm tinkering with is pretty similar to the regular old ZenCart template.
I guess my main questions is, on the product listing page, what is the correct way to call for the mfr name to display for each product? Is it:
<a href="' . zen_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing->fields['manufacturers_id']) . '">' . $listing->fields['manufacturers_name'] . '</a>
When I put that statement into my template it spits out the correct link but no anchor text. The href is there but the manufacturers name doesn't show up.
<a href="http://www.mysite.com/index.php?main_page=index&manufacturers_id=10"></a>
I don't really care about the link, I just want to show the name :huh: Maybe there is some flag or setting in admin that I missed?
For the template, I'm editing the $lc_text part of modules/my_template/product_listing.php file. Here is where I am at the moment. You can probably see where I added the $listing->fields['manufacturers_name'] bits.
for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {
$lc_align = '';
switch ($column_list[$col]) {
case 'PRODUCT_LIST_MODEL':
$lc_align = '';
$lc_text = '<div class="itemModel">'. $listing->fields['products_model'] . '</div>';
break;
case 'PRODUCT_LIST_NAME'://STEVE for boilerplate text Product Name as a link plus optional truncated description
$lc_align = '';
if (isset($_GET['manufacturers_id'])) {//true if its a manufacturer listing page STEVE bof Boilerplate text
if (!$is_slt_listing) {//normal product listing
$lc_text = '<div class="itemManufacturer"><a href="' . zen_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing->fields['manufacturers_id']) . '">' . $listing->fields['manufacturers_name'] . '</a></div><div class="itemTitle"><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']) . '">' . $listing->fields['products_name'] . '</a></div>';
} else {//Single Listing Template
$lc_text = '<div class="itemManufacturer"><a href="' . zen_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing->fields['manufacturers_id']) . '">' . $listing->fields['manufacturers_name'] . '</a></div><div class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($listing->fields['master_categories_id']) . '&products_id=' . $listing->fields['products_id']) . '">' . $listing->fields['products_name'] . '</a></div>';
}
} else {//not a manufacturer product listing, but the code loaded into $lc_text is the same in either case!!
if (!$is_slt_listing) {//normal product listing
$lc_text = '<div class="itemManufacturer"><a href="' . zen_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing->fields['manufacturers_id']) . '">' . $listing->fields['manufacturers_name'] . '</a></div><div class="itemTitle"><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']) . '">' . $listing->fields['products_name'] . '</a></div>';
} else {//Single Listing Template
$lc_text = '<div class="itemManufacturer"><a href="' . zen_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing->fields['manufacturers_id']) . '">' . $listing->fields['manufacturers_name'] . '</a></div><div class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($listing->fields['master_categories_id']) . '&products_id=' . $listing->fields['products_id']) . '">' . $listing->fields['products_name'] . '</a></div>';
}
}
break;
case 'PRODUCT_LIST_MANUFACTURER':
$lc_align = '';
$lc_text = '<div class="itemManufacturer"><a href="' . zen_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing->fields['manufacturers_id']) . '">' . $listing->fields['manufacturers_name'] . '</a></div>';
break;
case 'PRODUCT_LIST_PRICE':
$lc_price = '<div class="itemPrice">'.zen_get_products_display_price($listing->fields['products_id']) . '</div>';
$lc_align = 'right';
$lc_text = $lc_price;
Any ideas what I'm doing wrong?