Author Topic: Show Manufacturers information on "productdetails page"  (Read 27152 times)

Snake 60

  • Beginner
  • *
  • Posts: 12
    • Snake 60 BLOG
  • VirtueMart Version: 2.0.22a
Re: Show Manufacturers information on "productdetails page"
« Reply #45 on: August 25, 2013, 12:16:34 pm »
I think, need to write query to a DataBase for realize that. Is here any True PROgrammers? ;) I noob in php, but I will try to do that, becouse me need too this feature. :)

CasperH

  • Beginner
  • *
  • Posts: 13
Re: Show Manufacturers information on "productdetails page"
« Reply #46 on: August 12, 2015, 21:29:52 pm »
JamesSVk, thank you very very much for below code. It can easily be added on the detail page, requires no core changes, is upgrade proof and does exactly what it needs to do!

I'm replying to this "old" thread to also confirm this works for VM 3.0.9 and it hopefully points new people also to this solution, as it was still being asked in this thread even though a solution was provided.

I got solution, try this directly on your view site (/productdetails/tmpl/default.php or in template /html/com_virtuemart/productdetails/default.php):

Code: [Select]
<?
   JRequest::setVar('virtuemart_manufacturer_id',$this->product->virtuemart_manufacturer_id,'GET');
        $model = VmModel::getModel('manufacturer');
        if ($this->product->virtuemart_manufacturer_id !=0 ) {
$manufacturer = $model->getManufacturer();
$model->addImages($manufacturer,1);
$this->manufacturerImage = $manufacturer->images[0]->displayMediaThumb('class="manufacturer-image"',false);
                }
              echo $this->manufacturerImage;
  ?>

Geppux

  • Jr. Member
  • **
  • Posts: 130
Re: Show Manufacturers information on "productdetails page"
« Reply #47 on: December 10, 2015, 11:15:47 am »
I used the above solution and in my template/html/com_virtuemart/productdetails/default.php I replaced this code:
Code: [Select]
<?php
// Manufacturer of the Product
if (VmConfig::get('show_manufacturers'1) && !empty($this->product->virtuemart_manufacturer_id)) {
echo $this->loadTemplate('manufacturer');
}
?>

with this:
Code: [Select]
<?php
// Manufacturer of the Product

   
JRequest::setVar('virtuemart_manufacturer_id',$this->product->virtuemart_manufacturer_id,'GET');
        
$model VmModel::getModel('manufacturer');
        if (
$this->product->virtuemart_manufacturer_id !=) {
$manufacturer $model->getManufacturer();
$model->addImages($manufacturer,1);
$this->manufacturerImage $manufacturer->images[0]->displayMediaThumb('class="manufacturer-image"',false);
                }
              echo 
$this->manufacturerImage;
?>

and now I have the logo instead of the name of the manufacturer, but the name was linked, clicking on it I was going on the manufacturer virtuemart page and now it's no more linked... what I have to change to have the logo linked to the manufacturer page as before or, better, to display all the products of the manufacturer?
Thank you.
Giuseppe

escozul

  • Beginner
  • *
  • Posts: 23
  • Skype Name: escozul
Re: Show Manufacturers information on "productdetails page"
« Reply #48 on: March 16, 2017, 17:03:36 pm »
Hello,

The above code from Geppux still works for VM 3

However it seems that the link issue is not worked out yet and also, I'd like an if clause to acutally hide the image of the manufacturer if none is set. Right now, that code displays a no-image set image when a manufactrer has no logo.

Do you guys have any suggestions to that?

Thanks