VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: Meton on October 21, 2015, 14:20:53 PM

Title: Add manufacturer desc in manufacturere product selection
Post by: Meton on October 21, 2015, 14:20:53 PM
Hi guys,

Is it possible to add the manufacturer description to the catagory view page?

What i am trying to do is create a page with the products of a manufacturer and the description.

Currently when you go to the url

products/manufacturer/brand you will only get the products of that manufacturer. I would like to add a manufacturer description here.

Kind regards,

Meton
Title: Re: Add manufacturer desc in manufacturere product selection
Post by: Spiros Petrakis on October 23, 2015, 22:38:46 PM
Try the following code in components\com_virtuemart\views\category\tmpl\default.php or better in a template override for this view


if ($this->categoryId == '0') {

  $model = VmModel::getModel('Manufacturer');
  $manufacturers = $model->getManufacturers(true, true,true);
  foreach ($manufacturers as $manufacturer) {
    if ($manufacturer->mf_name == $this->category->category_name ) {
      echo $manufacturer->mf_desc;
    }
  }

}

Title: Re: Add manufacturer desc in manufacturere product selection
Post by: Vincenzo77 on May 09, 2018, 19:15:00 PM
Good evening,
the code works in part, ie it takes the name of the manufacturer, but not the manufacturer of the selected category.
In practice, by opening the DIOR category, I'm reminded of ZADIG & VOLTAIRE.
How can you solve?
Thank you
Title: Re: Add manufacturer desc in manufacturere product selection
Post by: Vincenzo77 on May 09, 2018, 20:19:36 PM
Sorry, I was wrong to enter the name of the category, instead of writing only DIOR I put BRANDS DIOR.
IT WORKS