Skip to main content

Show Brand Logo in Product View

More
13 years 6 months ago #96204 by PeterChain
I would like to replace brand label and name in the product view for the assigned logo image for that brand.

I don't find a setting for this and don't know how to "hack" the product view to do this.

I use style_pictureblue.css.

Please Log in or Create an account to join the conversation.

More
13 years 6 months ago #96299 by Xavier
Hi,

You have to edit the view "product / show_block_dimensions" and at the end of the file, replace:
Code:
$manufacturer = $class->get($this->element->product_manufacturer_id);
By:
Code:
$manufacturer = $class->get($this->element->product_manufacturer_id, true);

Then replace:
Code:
echo JText::_('MANUFACTURER').': '.'<a href="'.hikashop_completeLink('category&task=listing&cid='.$manufacturer->category_id.'&name='.$manufacturer->alias.'&Itemid='.$Itemid).'">'.$manufacturer->category_name.'</a>';
By a code to display the image too. The image is in the var: "$manufacturer->file_path;"

Please Log in or Create an account to join the conversation.

More
13 years 6 months ago #97187 by dyvymtvar
Peter, did you do it?

Please Log in or Create an account to join the conversation.

More
13 years 5 months ago #97738 by PeterChain
Sorry for the lack of response!

Finally trying to do it now. Will come back with the result!

Please Log in or Create an account to join the conversation.

More
13 years 4 months ago - 13 years 4 months ago #103005 by ax
Replied by ax on topic Show Brand Logo in Product View

Xavier wrote: Hi,

You have to edit the view "product / show_block_dimensions" and at the end of the file, replace:

Code:
$manufacturer = $class->get($this->element->product_manufacturer_id);
By:
Code:
$manufacturer = $class->get($this->element->product_manufacturer_id, true);

Then replace:
Code:
echo JText::_('MANUFACTURER').': '.'<a href="'.hikashop_completeLink('category&task=listing&cid='.$manufacturer->category_id.'&name='.$manufacturer->alias.'&Itemid='.$Itemid).'">'.$manufacturer->category_name.'</a>';
By a code to display the image too. The image is in the var: "$manufacturer->file_path;"


Hello Xavier, could you show the code to display the image. thanks
Last edit: 13 years 4 months ago by Jerome. Reason: setting quotes

Please Log in or Create an account to join the conversation.

More
13 years 4 months ago #103052 by nicolas
As Xavier said, you can use $manufacturer->file_path to display the image with the standard image display function of HikaShop:
Code:
echo $this->image->display($manufacturer->file_path,false,$manufacturer->file_name,'style="margin-top:10px;margin-bottom:10px;display:inline-block;vertical-align:middle"', '', 120, 80);
where 120 is the width and 80 the height of the thumbnail.

Please Log in or Create an account to join the conversation.

More
13 years 4 months ago #103105 by ax
Replied by ax on topic Show Brand Logo in Product View
I did it that way but it only loads the default not avaible image.


the manofacturers are linked to the images and the product to the manofacturer so it should be working.


what can be wrong?

thanks nicolas.

Please Log in or Create an account to join the conversation.

More
13 years 4 months ago - 13 years 4 months ago #103133 by Jerome
Hi,

The code display the image of the manufacturer.
I test it in a local website and it works good, just replacing the code as Xavier and Nicolas said.
Are you sure you replaced all elements like they said ?

Regards,

Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Last edit: 13 years 4 months ago by Jerome.

Please Log in or Create an account to join the conversation.

More
13 years 4 months ago #103170 by PeterChain
Hi,

As the original generator of this thread I can say the code worked fine for me since the first iteration of the code.

Please Log in or Create an account to join the conversation.

More
13 years 4 months ago #103176 by ax
Replied by ax on topic Show Brand Logo in Product View
I tried again and now its working, thanks!

Please Log in or Create an account to join the conversation.

Time to create page: 0.224 seconds
Powered by Kunena Forum