Jump to content

Show products per brand and sort brands


Recommended Posts

Hello,

 

I would like ot sort the brnds/manufactures in decending order by the number of products we have of each one, and show that number of products. How can this be done in both, the front office module and the manufacturers page?

 

 

Thanks in advance for your help.

 

Steven

Link to comment
Share on other sites

in controllers, manfacturercontroller.php, you have

 

'products' => $this->manufacturer->getProducts($this->manufacturer->id, (int)self::$cookie->id_lang, (int)$this->p, (int)$this->n, $this->orderBy, $this->orderWay),

 

you can replace orderby and orderway for 'date_add' for example and orderway for "ASC" or "DESC", This is for products, for manufacturers, is in classes, manufacturer.php and search the function getManufacturer and you get the

 

$sql.= ' ORDER BY m.`name` ASC'.($p ? ' LIMIT '.(((int)($p) - 1) * (int)($n)).','.(int)($n) : '');

Link to comment
Share on other sites

  • 1 month later...
×
×
  • Create New...