Does anyone know what code I need to add to the product.tpl file?
Thank you for your help.
Code: Select all
catalog\controller\product\product.php
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'] = '';
}
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;
}
Code: Select all
catalog\view\theme\default\template\product\product.tpl
Code: Select all
<span><?php echo $text_manufacturer; ?></span> <a href="<?php echo $manufacturers; ?>"><?php echo $manufacturer; ?></a><br />
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 />
Jimmy
News CMS || Plus SEO || Live Price change with Option Select
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>
But Kudos for the PHP Side, I've totally lost all my PHP Snippets when I wiped my phone :*(
A good site for e-commerce advice.
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
More Search Engine Friendly and User Friendly.Code: Select all
<a href="<?php echo $manufacturers; ?>" title="<?php echo $manufacturer; ?>"><?php echo ($manufacturers_img) ? '<img src="'.$manufacturers_img.'" alt="'.$manufacturer.'" />' : $manufacturers ;?></a>
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 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.
--------------------- 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
Brand: http://www.xxx.se/xxx/index.php?route=p ... urer_id=81
Is there a way of getting around this?
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?
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
<br />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 ;-)
Celestial - Martín Abel Rosales
WhatsApp: 50671482211
Email: martinrosales2012@hotmail.com
Skype: martin.abel.rosales
San José , Costa Rica
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
A coder by Hobby and Developer by Profession
Images in Manufacture
http://www.opencart.com/index.php?route ... on_id=6943
Description and images in Manufacture
http://www.opencart.com/index.php?route ... on_id=6978
http://codertj.com
jimmyphong wrote:open file :find code (line 194)Code: Select all
catalog\controller\product\product.php
add after with codeCode: 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'] = ''; }
open file :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; }
find code (line 27)Code: Select all
catalog\view\theme\default\template\product\product.tpl
replace with codeCode: Select all
<span><?php echo $text_manufacturer; ?></span> <a href="<?php echo $manufacturers; ?>"><?php echo $manufacturer; ?></a><br />
RegardsCode: 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 />
Jimmy
TRIED THIS AND IT DID NOT WORK FOR MY O/C 1.5.1.3
www.cozziemo.co.nz
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 />
Users browsing this forum: Baidu [Spider] and 210 guests