Post by xtremeoracing » Thu Apr 19, 2012 11:45 am

Opencart Version 1.5.1.3

I need some help on chaning how manufacturers display on the brands page. I want to show the logos rather than the manufacturer names. I also want to show the logo on the actual manufacturer's page.

Any help would be appreciated. Thanks in advance!

Newbie

Posts

Joined
Fri Aug 12, 2011 12:07 am

Post by Avvici » Thu Apr 19, 2012 12:37 pm

Step One:
Open up catalog/controller/product/manufacturer.php and look for this line of code:

Code: Select all

$this->data['categories'][$key]['manufacturer'][] = array(
                'name' => $result['name'],
                'href' => $this->url->link('product/manufacturer/product', 'manufacturer_id=' . $result['manufacturer_id'])
            );
         
This code grabs the image and re-sizes it. You can set the width and height manually. Replace the code above with this entire block:

Code: Select all

#width of thumbnail
$manufacturer_image_width = 50;
#height of thumbnail
            $manufacturer_image_height = 50;
            if ($result['image']) {
                $image = $this->model_tool_image->resize($result['image'], $manufacturer_image_width, $manufacturer_image_height);
            } else {
                $image = false;
            }
            $this->data['categories'][$key]['manufacturer'][] = array(
                'name' => $result['name'],
                'image' => $result['image'],
                'href' => $this->url->link('product/manufacturer/product', 'manufacturer_id=' . $result['manufacturer_id'])
            ); 
Step Two:
Now open up this file:catalog/view/theme/your_theme/template/product/manufacturer_list.tpl and find this line of code:

Code: Select all

<li><a href="<?php echo $category['manufacturer'][$i]['href']; ?>"><?php echo $category['manufacturer'][$i]['name']; ?></a></li>
If you want to show only thumbnails then replace it with this:

Code: Select all

 <li><a href="<?php echo $category['manufacturer'][$i]['href']; ?>"><img src="<?php echo $category['manufacturer'][$i]['image']; ?>" alt="<?php echo $category['manufacturer'][$i]['name']; ?>" /></a></li>
If you want to show both:

Code: Select all

 <li><a href="<?php echo $category['manufacturer'][$i]['href']; ?>"><?php echo $category['manufacturer'][$i]['name']; ?></a><br />
          <a href="<?php echo $category['manufacturer'][$i]['href']; ?>"><img src="<?php echo $category['manufacturer'][$i]['image']; ?>" alt="<?php echo $category['manufacturer'][$i]['name']; ?>" /></a></li>

User avatar
Expert Member

Posts

Joined
Tue Apr 05, 2011 12:09 pm
Location - Asheville, NC

Post by xtremeoracing » Fri Apr 20, 2012 4:13 am

Thanks alot for the quick response! I will give it a try and let you know how it goes!

Newbie

Posts

Joined
Fri Aug 12, 2011 12:07 am

Post by xtremeoracing » Fri Apr 20, 2012 4:25 am

Ok it seems to be working fine, but the image path is not correct. it is trying to pull the images from (example)

Code: Select all

http://www.highoctanemotoring.com/data/Manufacturers/ACT_Logo.jpg
but they are actually in (example)

Code: Select all

http://www.highoctanemotoring.com/[b]image[/b]/data/Manufacturers/ACT_Logo.jpg
here is a link to the page:
http://www.highoctanemotoring.com/index ... nufacturer

Newbie

Posts

Joined
Fri Aug 12, 2011 12:07 am

Post by alikhan99 » Sun Sep 09, 2012 1:42 am

What about the Manufacture page? how to display the logo there ?

Active Member

Posts

Joined
Fri Jun 29, 2012 4:57 pm

Post by hebiki » Fri Oct 12, 2012 12:25 pm

any updates on this? the image gets pulled in.... but it doesnt show -120x120 size for it.

im on 1.5.3

New member

Posts

Joined
Sun Oct 10, 2010 4:00 pm
Who is online

Users browsing this forum: No registered users and 7 guests