Post by unknownmale1 » Fri Dec 31, 2010 1:47 am

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

Active Member

Posts

Joined
Sat Aug 28, 2010 6:46 pm

Post by Chones » Sat Jan 01, 2011 12:31 am

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

Code: Select all

'name'    => $result['name'],
Of course, I'm assuming the getProductsByCategoryId() function actually loads manufacturer details - sorry, am too busy to run a check.

http://scarletandjones.com/
http://sharpdressedman.co.uk/
http://coffincompany.co.uk/
http://horsesculptures.co.uk/
If I've helped you out, why not buy me a beer? http://craigmurray.me.uk


User avatar
Active Member

Posts

Joined
Wed Mar 24, 2010 9:07 pm
Location - London

Post by delirium2k » Mon Jan 10, 2011 6:51 am

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.

Newbie

Posts

Joined
Sun Jan 09, 2011 10:34 am

Post by Qphoria » Mon Jan 10, 2011 6:58 am

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

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by marc_cole » Mon Jan 10, 2011 9:14 am

Qphoria wrote:so we can have everything available at the view level as needed
Yes. That's an excellent idea!

OpenCart v1.4.9.4
VQMod | Categories Home | Cleaner By Default - 2 Column | Speak Good English


Active Member

Posts

Joined
Tue Dec 14, 2010 11:26 am
Location - Seattle, WA

Post by brionace » Wed Nov 28, 2012 10:14 pm

Thanks alot!!!!!!!!!!!!!!!!
Chones reply worked for me.
Brilliant. :)

Newbie

Posts

Joined
Thu Nov 22, 2012 12:02 am

Post by kajaah » Thu Dec 12, 2013 7:54 am

Sorry, but this did not work for me. I'm with 1.5.6 version.
Says: Undefined variable: product_info.

Any help?

Newbie

Posts

Joined
Wed Nov 13, 2013 10:49 am

Post by arturocivit » Thu Sep 18, 2014 7:18 am

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

Code: Select all

'name'    => $result['name'],
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

New member

Posts

Joined
Thu Dec 01, 2011 1:50 am
Who is online

Users browsing this forum: No registered users and 0 guests