sbm Posted September 28, 2012 Share Posted September 28, 2012 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 More sharing options...
shacker Posted October 4, 2012 Share Posted October 4, 2012 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 More sharing options...
sbm Posted October 4, 2012 Author Share Posted October 4, 2012 I am sorry, but really dont understand how to modify this to order manufacturers by the number of products they have. Do you mind make it "for dummies" (step by step) please? Link to comment Share on other sites More sharing options...
mmsh Posted November 22, 2012 Share Posted November 22, 2012 (edited) shacker, you're not explaining anything with that... because the ps_manufacturer table has only name to sort (ORDER BY...) so, how to sort the blockmanufacturer by the number of products? thanks Edited November 22, 2012 by mmsh (see edit history) Link to comment Share on other sites More sharing options...
shacker Posted November 22, 2012 Share Posted November 22, 2012 i reply to the post title, maybe read wrong the post Link to comment Share on other sites More sharing options...
mmsh Posted November 22, 2012 Share Posted November 22, 2012 don't think so, "sort brands" is clear. anyway, if you can help I thank you...for sure is not your falt, but it's licit to ask, some features have been rendered difficult because of this tables schema.... Link to comment Share on other sites More sharing options...
Recommended Posts