Support Team
posted this
05 April 2021
Add this code to CMS Code control:
<?php if(!empty($product->virtuemart_manufacturer_id))
{
$model = VmModel::getModel('manufacturer');
foreach($product->virtuemart_manufacturer_id as $manufacturer_id)
{
$model->setId($manufacturer_id);
$manufacturer = $model->getManufacturer();
$model->addImages($manufacturer);
$thumbnail_image = $manufacturer->images[0]->displayMediaThumb('class="mfg-thumbnail-image"', false);
}
} ?>
<a href="<?php echo JRoute::_('index.php?option=com_virtuemart&view=category&virtuemart_category_id=0&virtuemart_manufacturer_id=' . $this->product->virtuemart_manufacturer_id[0], false); ?>"><?php echo $manufacturer->images[0]->displayMediaThumb(false,false);?></a>
It works on my end:
But as you can see I have also added Manufacturer's Name control. You can try without it first.
Gina
Add this code to CMS Code control:
<?php if(!empty($product->virtuemart_manufacturer_id))
{
$model = VmModel::getModel('manufacturer');
foreach($product->virtuemart_manufacturer_id as $manufacturer_id)
{
$model->setId($manufacturer_id);
$manufacturer = $model->getManufacturer();
$model->addImages($manufacturer);
$thumbnail_image = $manufacturer->images[0]->displayMediaThumb('class="mfg-thumbnail-image"', false);
}
} ?>
<a href="<?php echo JRoute::_('index.php?option=com_virtuemart&view=category&virtuemart_category_id=0&virtuemart_manufacturer_id=' . $this->product->virtuemart_manufacturer_id[0], false); ?>"><?php echo $manufacturer->images[0]->displayMediaThumb(false,false);?></a>
It works on my end:
!Screenshot-1.png!
But as you can see I have also added Manufacturer's Name control. You can try without it first.
Gina