Hi there,
is there an option to get all manufacturer names of a product in the category view?
For now I am using $product->mf_name, but this only gives me the first manufacturer selected. The second one is not shown at all.
Kind regards
Tanja
You can print all the manufacturer names assigned to a product using the following codes.
<?php
$manufacturerModel = VmModel::getModel('manufacturer');
if (is_array($product->virtuemart_manufacturer_id) && count($product->virtuemart_manufacturer_id) > 1) {
foreach ($product->virtuemart_manufacturer_id as $manufacturerId) {
$manufacturer = $manufacturerModel->getManufacturer($manufacturerId);
echo $manufacturer->mf_name;
}
} elseif (!empty($product->mf_name)) {
echo $product->mf_name;
}
Thank you, Jumbo.
That helped.