News:

Support the VirtueMart project and become a member

Main Menu

How to display manufacturer name and link on category page with VM3

Started by YCWAY, April 11, 2015, 06:33:50 AM

Previous topic - Next topic

YCWAY

Hello,

VM previous version, this code is work


<?php echo $product->mf_name ?>

<?php echo $product->virtuemart_manufacturer_id ?>


But for VM3, manufacturers can be multiple choice, so when a product is a multi-manufacturer, when the above code does not work

How to display manufacturer name and link on category page with VM3 ?

Thanks~

Joomla 3.4.1
VirtueMart 3.0.6.4

Studio 42

Adapt it from productdetails view :
if (VmConfig::get('show_manufacturers', 1) && !empty($this->product->virtuemart_manufacturer_id)) {
$manModel = VmModel::getModel('manufacturer');
$mans = array();
// Gebe die Hersteller aus
foreach($this->product->virtuemart_manufacturer_id as $manufacturer_id) {

$mans[] = $manModel->getManufacturer( $manufacturer_id );
}
$this->product->manufacturers = $mans;

YCWAY

Hi, Studio 42
Thank you for your reply;
I tried using the code you provided, but an error occurred
Or that I have not clearly described, I hope each product category pages are displayed its manufacturer and links.
So I need to modify the templates/my_template/html/com_virtuemart/sublayouts/products.php file to display the manufacturer of each product.
How should I change?
THX

Studio 42