Skip to main content

Re: Displaying manufacturer's picture on product page?

15 years 4 months ago #20324 by pproject
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.

15 years 4 months ago #20335 by nicolas
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.

15 years 4 months ago #20365 by pproject
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.

6 years 1 week ago #325935 by amaurice
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.

6 years 1 week ago #325942 by Mohamed Thelji
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.053 seconds
Powered by Kunena Forum