Page 1 of 2

How to Show Manufacturer Logo on Product Page

Posted: Wed Dec 21, 2011 11:43 pm
by Brook
I have OpenCart 1.5.1.3 installed. I want to show the Manufacturer Logo on the product.tpl product page. How do I replace the Manufacturer Name link that is on the product.tpl page with the actual Manufacturer Logo of the Product?

Does anyone know what code I need to add to the product.tpl file?

Thank you for your help.

Re: How to Show Manufacturer Logo on Product Page

Posted: Thu Dec 22, 2011 2:01 am
by jimmyphong
open file :

Code: Select all

catalog\controller\product\product.php
find code (line 194)

Code: Select all

if ($product_info['image']) {
				$this->data['popup'] = $this->model_tool_image->resize($product_info['image'], $this->config->get('config_image_popup_width'), $this->config->get('config_image_popup_height'));
			} else {
				$this->data['popup'] = '';
			}
add after with code

Code: Select all

$manufacturer_image = $this->model_catalog_manufacturer->getManufacturer($product_info['manufacturer_id']);
			 
			if($manufacturer_image){
				$this->data['manufacturers_img'] = $this->model_tool_image->resize($manufacturer_image['image'], 50, 50);
			}else{
				$this->data['manufacturers_img'] = false;
			}
open file :

Code: Select all

catalog\view\theme\default\template\product\product.tpl
find code (line 27)

Code: Select all

 <span><?php echo $text_manufacturer; ?></span> <a href="<?php echo $manufacturers; ?>"><?php echo $manufacturer; ?></a><br />
replace with code

Code: Select all

<span><?php echo $text_manufacturer; ?></span> <a href="<?php echo $manufacturers; ?>"><?php echo ($manufacturers_img) ? '<img src="'.$manufacturers_img.'" title="'.$manufacturers.'" />' : $manufacturers ;?></a><br />
Regards
Jimmy

Re: How to Show Manufacturer Logo on Product Page

Posted: Mon Dec 26, 2011 7:41 am
by Brook
Jimmy,

Your solution worked great! Thank you.

Re: How to Show Manufacturer Logo on Product Page

Posted: Tue Feb 07, 2012 12:52 am
by dijitul
Sorry but Jimmy is incorrect with his TPL replace code.

I cannot stress enough that... THERE IS NO TITLE ATTRIBUTE FOR IMG

ITS AN ALT!!!! TITLE IS ONLY ON LINKS!!!!

Anyway

Code: Select all

<a href="<?php echo $manufacturers; ?>" title="<?php echo $manufacturer; ?>"><?php echo ($manufacturers_img) ? '<img src="'.$manufacturers_img.'" alt="'.$manufacturer.'" />' : $manufacturers ;?></a>
More Search Engine Friendly and User Friendly.


But Kudos for the PHP Side, I've totally lost all my PHP Snippets when I wiped my phone :*(

Re: How to Show Manufacturer Logo on Product Page

Posted: Fri Mar 16, 2012 4:38 am
by H2O
Wanted to do the same thing. Thanks for the code. It worked great.

Re: How to Show Manufacturer Logo on Product Page

Posted: Wed Apr 04, 2012 4:24 am
by platinum
Is there a way to make it so the logo doesn't resize. I need it to put the actual size of the logo in that section.

Re: How to Show Manufacturer Logo on Product Page

Posted: Wed Apr 04, 2012 4:32 am
by Avvici
dijitul wrote:Sorry but Jimmy is incorrect with his TPL replace code.

I cannot stress enough that... THERE IS NO TITLE ATTRIBUTE FOR IMG

ITS AN ALT!!!! TITLE IS ONLY ON LINKS!!!!

Anyway

Code: Select all

<a href="<?php echo $manufacturers; ?>" title="<?php echo $manufacturer; ?>"><?php echo ($manufacturers_img) ? '<img src="'.$manufacturers_img.'" alt="'.$manufacturer.'" />' : $manufacturers ;?></a>
More Search Engine Friendly and User Friendly.


But Kudos for the PHP Side, I've totally lost all my PHP Snippets when I wiped my phone :*(


Actually you are not correct. Title attribute applies to both Images and A HREF :o One cancels out the other in the order of things. It's always safer to use title in A HREF because it ensures that it shows up in all browsers.

Re: [SOLVED] How to Show Manufacturer Logo on Product Page

Posted: Mon Apr 09, 2012 7:09 pm
by Solan
Thanks for this solution.. i have just one problem and that is when using image size 50 50 its to small and when i make it eg. 100 100 i get the image to high up.

--------------------- LOGO IMAGE

Brand:
Product Code: 12345
Availability: In Stock

Is there a way to have the Brand beside the logo image?

[SOLVED] Just change the size of the image

Re: How to Show Manufacturer Logo on Product Page

Posted: Mon Apr 09, 2012 7:56 pm
by Solan
And also.. if the brand doesnt have a logo the item gets an ugly link instead of a logo..

Brand: http://www.xxx.se/xxx/index.php?route=p ... urer_id=81


Is there a way of getting around this?

Re: How to Show Manufacturer Logo on Product Page

Posted: Mon Apr 09, 2012 10:56 pm
by Avvici
No, you need to assign an SEO keyword to each that is different in alias. There is no code that inserts a default random string as the SEO keyword.

Re: How to Show Manufacturer Logo on Product Page

Posted: Wed Apr 11, 2012 5:15 am
by Solan
avvici wrote:No, you need to assign an SEO keyword to each that is different in alias. There is no code that inserts a default random string as the SEO keyword.
Who were you answering? :)

Re: How to Show Manufacturer Logo on Product Page

Posted: Wed Apr 11, 2012 8:07 am
by Avvici
I thought I was answering you, after looking at your ugly link:)

Re: How to Show Manufacturer Logo on Product Page

Posted: Thu Apr 19, 2012 3:30 am
by Solan
*lol*

Okay, i dont get it.. *feel ashamed*

I have brands with logos and i also have products with no brand logo.

If one product doesnt have a brand with a logo image, instead of not showing an image it shows a link instead (like the example above).

on products I would like to have the brandname instead of logo if there is no logo to show... instead of that ugly link ;-)

Is this possible?

Re: How to Show Manufacturer Logo on Product Page

Posted: Sun Apr 29, 2012 8:39 am
by Solan
I bet there must be a way of having a logo show IF there is a image to this brand and the name If there is no image to the brand??

Re: How to Show Manufacturer Logo on Product Page

Posted: Wed May 23, 2012 8:37 am
by az-vm
Hello,

Is there a way to not show the link, when there is no brand image

Do this on the product.tpl file

<?php if ($manufacturers_img) { ?>
<a href="<?php echo $manufacturers; ?>" title="<?php echo $manufacturer; ?>"><?php echo ($manufacturers_img) ? '<img src="'.$manufacturers_img.'" alt="'.$manufacturer.'" />' : $manufacturers ;?></a>
<?php } ?>


Many Thank´s for this script! :)

Regard´s,
az-vm

Re: How to Show Manufacturer Logo on Product Page

Posted: Thu May 24, 2012 3:30 pm
by Solan
Thanks, but how do i get a new line after the logo and the modelnr?
Now i have the logo at the same line and its not nice ;-)

Re: How to Show Manufacturer Logo on Product Page

Posted: Fri May 25, 2012 1:21 am
by celestial
Solan wrote:Thanks, but how do i get a new line after the logo and the modelnr?
Now i have the logo at the same line and its not nice ;-)
<br />

Re: How to Show Manufacturer Logo on Product Page

Posted: Sat Jun 23, 2012 4:09 pm
by trinkaljuneja
module for manufacture image and description

free
http://www.opencart.com/index.php?route ... on_id=6943

paid
http://www.opencart.com/index.php?route ... on_id=6978

paid version also support description from admin and image hover effect

Re: How to Show Manufacturer Logo on Product Page

Posted: Thu Nov 22, 2012 6:35 am
by cozzienz
jimmyphong wrote:open file :

Code: Select all

catalog\controller\product\product.php
find code (line 194)

Code: Select all

if ($product_info['image']) {
				$this->data['popup'] = $this->model_tool_image->resize($product_info['image'], $this->config->get('config_image_popup_width'), $this->config->get('config_image_popup_height'));
			} else {
				$this->data['popup'] = '';
			}
add after with code

Code: Select all

$manufacturer_image = $this->model_catalog_manufacturer->getManufacturer($product_info['manufacturer_id']);
			 
			if($manufacturer_image){
				$this->data['manufacturers_img'] = $this->model_tool_image->resize($manufacturer_image['image'], 50, 50);
			}else{
				$this->data['manufacturers_img'] = false;
			}
open file :

Code: Select all

catalog\view\theme\default\template\product\product.tpl
find code (line 27)

Code: Select all

 <span><?php echo $text_manufacturer; ?></span> <a href="<?php echo $manufacturers; ?>"><?php echo $manufacturer; ?></a><br />
replace with code

Code: Select all

<span><?php echo $text_manufacturer; ?></span> <a href="<?php echo $manufacturers; ?>"><?php echo ($manufacturers_img) ? '<img src="'.$manufacturers_img.'" title="'.$manufacturers.'" />' : $manufacturers ;?></a><br />
Regards
Jimmy

TRIED THIS AND IT DID NOT WORK FOR MY O/C 1.5.1.3
www.cozziemo.co.nz

Re: How to Show Manufacturer Logo on Product Page

Posted: Thu Nov 22, 2012 8:44 am
by cozzienz
Can someone point out how to apply this part below to my custom theme as i have a feeling this is why it is not working

open file :

Code: Select all
catalog\view\theme\default\template\product\product.tpl


find code (line 27)

Code: Select all
<span><?php echo $text_manufacturer; ?></span> <a href="<?php echo $manufacturers; ?>"><?php echo $manufacturer; ?></a><br />


replace with code

Code: Select all
<span><?php echo $text_manufacturer; ?></span> <a href="<?php echo $manufacturers; ?>"><?php echo ($manufacturers_img) ? '<img src="'.$manufacturers_img.'" title="'.$manufacturers.'" />' : $manufacturers ;?></a><br />