garaiko Posted June 23, 2015 Share Posted June 23, 2015 Hi, when I click to see the list of manufacturers with the amount of product from each manufacturer, the list shows ALL the 64 products under one single manufacturer despite the fact that they belong to different ones. And all the other manufacturers show 0 product. Then when you click the button "See products" next to that manufacturer, it only shows you 8 products which is correct as that manufacturer only has 8 products. How can I get this corrected, so that the right amount of products is shown next to each manufacturer? I am attaching a screencapture. Thanks. Link to comment Share on other sites More sharing options...
Dh42 Posted June 23, 2015 Share Posted June 23, 2015 Is this 1.6.0.14? If so it is a bug fixed in the latest version. Link to comment Share on other sites More sharing options...
garaiko Posted June 23, 2015 Author Share Posted June 23, 2015 Yes Dh42, I have Prestashop 1.6.0.14 and the bug is not fixed. Please let me know how to handle it. I don't mind having to add lines to any tpl file or to other files. Link to comment Share on other sites More sharing options...
Dh42 Posted June 23, 2015 Share Posted June 23, 2015 I think this might be what you are looking for, https://github.com/PrestaShop/PrestaShop/pull/2577 Link to comment Share on other sites More sharing options...
garaiko Posted June 23, 2015 Author Share Posted June 23, 2015 Yes, thank you for your help. That handled the problem. I just had to open class/Manufacturer.php, delete $results = ...... ); from line 191 to line 205 and write the code below instead. $results = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS(' SELECT p.`id_manufacturer`, COUNT(DISTINCT p.`id_product`) as nb_products FROM `'._DB_PREFIX_.'product` p USE INDEX (product_manufacturer) '.Shop::addSqlAssociation('product', 'p').' LEFT JOIN `'._DB_PREFIX_.'manufacturer` as m ON (m.`id_manufacturer`= p.`id_manufacturer`) WHERE p.`id_manufacturer` != 0 AND product_shop.`visibility` NOT IN ("none") '.($active ? ' AND product_shop.`active` = 1 ' : '').' '.($all_group ? '' : ' AND EXISTS ( SELECT 1 FROM `'._DB_PREFIX_.'category_group` cg LEFT JOIN `'._DB_PREFIX_.'category_product` cp ON (cp.`id_category` = cg.`id_category`) WHERE p.`id_product` = cp.`id_product` AND cg.`id_group` '.$sql_groups.' )').' GROUP BY p.`id_manufacturer`' ); You should get this corrected in future versions of prestashop or with the updates. Regards. Link to comment Share on other sites More sharing options...
Recommended Posts