Show Brand Logo in Product View

  • Posts: 634
  • Thank you received: 16
11 years 7 months ago #96204

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.

Attachments:

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

  • Posts: 13201
  • Thank you received: 2322
11 years 7 months ago #96299

Hi,

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

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

Then replace:
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.

  • Posts: 104
  • Thank you received: 0
11 years 7 months ago #97187

Peter, did you do it?

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

  • Posts: 634
  • Thank you received: 16
11 years 7 months ago #97738

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.

  • Posts: 14
  • Thank you received: 1
11 years 5 months ago #103005

Xavier wrote: Hi,

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

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

Then replace:
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: 11 years 5 months ago by Jerome. Reason: setting quotes

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

  • Posts: 82760
  • Thank you received: 13346
  • MODERATOR
11 years 5 months ago #103052

As Xavier said, you can use $manufacturer->file_path to display the image with the standard image display function of HikaShop:

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.

  • Posts: 14
  • Thank you received: 1
11 years 5 months ago #103105

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.

  • Posts: 26151
  • Thank you received: 4027
  • MODERATOR
11 years 5 months ago #103133

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.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Last edit: 11 years 5 months ago by Jerome.

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

  • Posts: 634
  • Thank you received: 16
11 years 5 months ago #103170

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.

  • Posts: 14
  • Thank you received: 1
11 years 5 months ago #103176

I tried again and now its working, thanks!

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

Time to create page: 0.094 seconds
Powered by Kunena Forum