![]() |
Display Manufacturer Name on Products Page
Hi,
I am trying to show the Manufacturer name (and link to the manufacturer) on the products pages. In the products_t.tpl adding Code:
<a href="manufacturers.php?manufacturerid={$product.manufacturerid}">{$product.manufacturer}</a> If I put the same code in the product.tpl page, it displays the manufacturer correctly. Any ideas how I can add it to the products page? Is there something missing from the php file? Thanks, Jenny |
Re: Display Manufacturer Name on Products Page
Manufacturer name may not be included in the products array on that page. You can look in the debugger what's available. If it's not included products.php must be modified to include manufacturer
|
Re: Display Manufacturer Name on Products Page
How would I go about including it in the array?
It seems that - {$product.manufacturerid} is included, just not the Manufacturer name. Thanks, Jenny |
Re: Display Manufacturer Name on Products Page
You will have to edit a php file for that, most likely include/search.php
|
Re: Display Manufacturer Name on Products Page
Do you know what I need to add to the php file? Any specific instructions would be appreciated.
|
Re: Display Manufacturer Name on Products Page
BACKUP FIRST. THIS IS NOT TESTED.
Try adding this in products.php just before $smarty->assign("cat_products", $products); if (!empty($products)) { foreach ($products as $k=>$v) $products[$k]['manufacturer'] = func_query_first_cell("SELECT manufacturer FROM $sql_tbl[manufacturers] WHERE manufacturerid = $v[manufacturerid]"); } |
Re: Display Manufacturer Name on Products Page
@cflsystems, your code worked like a charm! Here's the full code I used
In products.php below: $smarty->assign('cat_products', isset($products) ? $products : array()); HTML Code:
Then add the following code into your product_details.tpl page where ever you want it HTML Code:
<a href="manufacturers.php?manufacturerid={$product.manufacturerid}">{$product.manufacturer}</a> |
Re: Display Manufacturer Name on Products Page
That worked perfectly for me as well.
Any ideas how I would do it on the invoice page? as well as the cart summary on the last step of the fast lane checkout? Thanks again for your help. Jenny |
Re: Display Manufacturer Name on Products Page
Hi,
This is very interesting. I am trying to pull the manufacturer to the products_list file and tried your code. It didn't work. Does your code need to be changed to get what I need? Thanks, Alexis |
Re: Display Manufacturer Name on Products Page
Any idea how you would display the manufacturer logo and link to manufacturer page on the products page instead of the name?
|
All times are GMT -8. The time now is 12:25 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.