Page 1 of 1
Display Manufacturer on category pages?
Posted: Fri Dec 31, 2010 1:47 am
by unknownmale1
I wanted to add the manufacturers name on each product under the categories page.
So you would see the image thumbnail, manufacturer then price.
I've added this into category.tpl
Code: Select all
<?php if ($manufacturer) { ?>
<a href="<?php echo str_replace('&', '&', $manufacturers); ?>"><?php echo $manufacturer; ?></a>
<?php } ?>
Which brings up errors as i've not yet edited category.php as i'm unsure what to do.
Any ideas would be a big help.
thanks
Re: Display Manufacturer on category pages?
Posted: Sat Jan 01, 2011 12:31 am
by Chones
In catalog > controller > product > product.php there are the lines
Code: Select all
$this->data['manufacturer'] = $product_info['manufacturer'];
$this->data['manufacturers'] = $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/manufacturer&manufacturer_id=' . $product_info['manufacturer_id']);
You basically have to add the same thing to catalog > controller > product > category.php although it should be along the lines of
Code: Select all
'manufacturer' => $result['manufacturer'],
Put it after this line
Of course, I'm assuming the getProductsByCategoryId() function actually loads manufacturer details - sorry, am too busy to run a check.
Re: Display Manufacturer on category pages?
Posted: Mon Jan 10, 2011 6:51 am
by delirium2k
I'm trying to do this exact same thing. However, my coding knowledge is very limited and I've been unable to find the right places to add this code. I'm working on a grocery store website and it is important that manufacturer names display when browsing. Any pointers would be appreciated.
Re: Display Manufacturer on category pages?
Posted: Mon Jan 10, 2011 6:58 am
by Qphoria
This reminds me, I'd like to get this going:
http://forum.opencart.com/viewtopic.php?f=24&t=16910
so we can have everything available at the view level as needed
Re: Display Manufacturer on category pages?
Posted: Mon Jan 10, 2011 9:14 am
by marc_cole
Qphoria wrote:so we can have everything available at the view level as needed
Yes. That's an excellent idea!
Re: Display Manufacturer on category pages?
Posted: Wed Nov 28, 2012 10:14 pm
by brionace
Thanks alot!!!!!!!!!!!!!!!!
Chones reply worked for me.
Brilliant.

Re: Display Manufacturer on category pages?
Posted: Thu Dec 12, 2013 7:54 am
by kajaah
Sorry, but this did not work for me. I'm with 1.5.6 version.
Says: Undefined variable: product_info.
Any help?
Re: Display Manufacturer on category pages?
Posted: Thu Sep 18, 2014 7:18 am
by arturocivit
Chones wrote:In catalog > controller > product > product.php there are the lines
Code: Select all
$this->data['manufacturer'] = $product_info['manufacturer'];
$this->data['manufacturers'] = $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/manufacturer&manufacturer_id=' . $product_info['manufacturer_id']);
You basically have to add the same thing to catalog > controller > product > category.php although it should be along the lines of
Code: Select all
'manufacturer' => $result['manufacturer'],
Put it after this line
Of course, I'm assuming the getProductsByCategoryId() function actually loads manufacturer details - sorry, am too busy to run a check.
Chones, thanks for that, it worked fine for me, what I did was to add the following on the category list template:
Code: Select all
<div class="name">
<a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a>
<div class="manufacturer" style="min-height: 30px;">
<a href="#"><?php echo $product['manufacturer']; ?></a>
</div>
</div>
The only question I have is, how to link to the specific manufacturer? I just tried a few things but it returns an error when clicked, any idea?
Thanks so much!!
Arturo