Re: Displaying manufacturer's picture on product page?

  • Posts: 16
  • Thank you received: 0
12 years 9 months ago #20324

Hi Nicolas,

I have tried to modify Display> Product > show file, according to display the picture which
belongs to manufacturer, but I'm really frustrated. I can't get product_manufacturer_id from
database which only connect to parent_product and if I change the variant, id is zero, so still I should
use parent_product.
Any hint would be highly appreciated. My PHP knowledge very limited.
Thanks in advance.

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

  • Posts: 81540
  • Thank you received: 13071
  • MODERATOR
12 years 9 months ago #20335

Hi,

If you use variants, you should be able to find the manufacturer id in $this->element->main->product_manufacturer_id

However, loading the image of the manufacturer on the product page is not easy as you first need to load the image information from the database before being able to use it to display the image.

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

  • Posts: 16
  • Thank you received: 0
12 years 9 months ago #20365

Thanks your help Nicolas! Finally I could manage that.

<div id="hikashop_product_manufacturer" class="hikashop_product_manufacturer">
<?php if(isset($this->element->main->product_manufacturer_id) && bccomp($this->element->main->product_manufacturer_id,0,3)){
$man_id = $this->element->main->product_manufacturer_id ;
$database =& JFactory::getDBO();
$query1 = 'SELECT file_path FROM '.hikashop_table('file').' WHERE file_ref_id IN ('.$man_id.') AND file_type IN (\'category\')';
$database->setQuery($query1);
$man_file_name = $database->loadResult();
echo $this->image->display($man_file_name) ;
}
?>
</div>

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

  • Posts: 20
  • Thank you received: 3
3 years 5 months ago #325935

Hello, can you please tell me where did you place this code ?
Thank you !

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

  • Posts: 12953
  • Thank you received: 1778
3 years 5 months ago #325942

Hello,

He modified files of the "product" view via "Hikashop->Display->Views", for more information :
www.hikashop.com/support/documentation/1...-display.html#layout

Note that this thread is 9 years old, so the code in this thread will probably not be valid anymore for what you want to achieve.

Kind regards,
Mohamed.

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

Time to create page: 0.082 seconds
Powered by Kunena Forum