AbanteCart Community

Shopping Cart Operations => Support => Template Support => Topic started by: illusion on January 01, 2013, 05:09:50 PM

Title: Manufacturer logo on product page?
Post by: illusion on January 01, 2013, 05:09:50 PM
is it possible to add the manufacturer logo to the product.tpl ?

Thank you for answer
Title: Re: Manufacturer logo on product page?
Post by: abantecart on January 01, 2013, 11:04:29 PM
There are number of ways you can do this.

1. You can create a custom block with manufacture selected or media block with image(icon) of manufacturer.
You would need to create this for every manufacturer and add proper block to each product's layout 
This is pain if you have too many manufacturers and products.

2. You can change code to add manufacturer icon on product details page (middle section).

Change the following 2 files:
Controller: /storefront/controller/pages/product/product.php
about line 291after:
Code: [Select]
$this->data['product_id'] = $product_id;
$this->data['average'] = $average;
Add
Code: [Select]
$resource = new AResource('image');
$thumbnail = $resource->getMainThumb('manufacturers',
$product_info['manufacturer_id'],
$this->config->get('config_image_grid_width'),
$this->config->get('config_image_grid_height'),
true);
$this->data['manufacturer_icon'] = $thumbnail['thumb_url'];

and 
Template: /storefront/view/default/template/pages/product/product.tpl
About line 166:
Code: [Select]
<a href="<?php echo $manufacturers?>"><?php echo $manufacturer?></a>Replace with:
Code: [Select]
<a href="<?php echo $manufacturers?>"><img src="<?php echo $manufacturer_icon?>" border="0" title="<?php echo $manufacturer?>" /></a>
3. You can change manufacturer static block to show manufacturer icon if in product detail page. You need to add manufactures block to generic product details layout one time.
These has been added to version 1.1.3 but you can copy below files to your abantecart:
https://github.com/abantecart/abantecart-src/blob/2ca3dc68fe2c6e9ef8b48582470f18b2102cbfb1/public_html/storefront/controller/blocks/manufacturer.php
https://github.com/abantecart/abantecart-src/blob/2ca3dc68fe2c6e9ef8b48582470f18b2102cbfb1/public_html/storefront/view/default/template/blocks/manufacturer.tpl