marcusg Posted January 1, 2010 Share Posted January 1, 2010 I'm managing a webshop for a friend (which we released only two days ago). He put up six products on sale, and I noticed that the pagination on prices_drop.php where incorrect. It displays the six products on sale, but paginates for the total product count!I checked the Product::GetPricesDrop, and this is the code that gets the product count: $sql = ' SELECT COUNT(DISTINCT p.`id_product`) AS nb FROM `'._DB_PREFIX_.'product` p WHERE p.`active` = 1 AND p.`id_product` IN ( SELECT cp.`id_product` FROM `'._DB_PREFIX_.'category_group` cg LEFT JOIN `'._DB_PREFIX_.'category_product` cp ON (cp.`id_category` = cg.`id_category`) WHERE cg.`id_group` '.(!$cookie->id_customer ? '= 1' : 'IN (SELECT id_group FROM '._DB_PREFIX_.'customer_group WHERE id_customer = '.intval($cookie->id_customer).')').' )'; Shouldn't this question contain a bit more in the Where-caluse, like in the question used to get the products in the same function: WHERE (`reduction_price` > 0 OR `reduction_percent` > 0) '.((!$beginning AND !$ending) ? 'AND (`reduction_from` = `reduction_to` OR (`reduction_from` <= \''.pSQL($currentDate).'\' AND `reduction_to` >= \''.pSQL($currentDate).'\'))' : ($beginning ? 'AND `reduction_from` <= \''.pSQL($beginning).'\'' : '').($ending ? 'AND `reduction_to` >= \''.pSQL($ending).'\'' : '')).' AND p.`active` = 1 AND p.`id_product` IN [...] I tested this, and it seems to work. Still learning prestashop though, so I just wanted to check if it looks OK. And if it's indeed a bug in PS, make sure it's fixed. Link to comment Share on other sites More sharing options...
sm3004 Posted February 11, 2010 Share Posted February 11, 2010 i have the same issue, except I have 125 products in prices-drop.php with 24 products per page, yet it is displaying that there are 14 pages, instead of only 6!What exactly did you do/change/add in the code to fix it??? Link to comment Share on other sites More sharing options...
bigstef Posted April 26, 2010 Share Posted April 26, 2010 If you have not found the answer to this yet you will get the fix herehttp://www.prestashop.com/forums/viewthread/17073/general_discussion/solved_price_drop__specials_page_numbers_issue Link to comment Share on other sites More sharing options...
sm3004 Posted April 27, 2010 Share Posted April 27, 2010 Did you test this out and it works? Which PrestaShop version does it work with? Link to comment Share on other sites More sharing options...
bigstef Posted April 27, 2010 Share Posted April 27, 2010 I had my prices-drop page showing 7 pages when in reality there was only 2. This fix sorted it out for my site no problem. I am using 1.2.4Just replace the function with the code listed on the post I gave you and it will be sorted. Link to comment Share on other sites More sharing options...
Guidiap Posted April 22, 2011 Share Posted April 22, 2011 Arf this doesn't fix the problem for me... the thing that is unbelievable is that the pagination (based on Smarty $nbProducts) is right in 'new-products.php" (which is actually static public function getNewProducts in ./classes/Product.php)Any idea ? Thanks Link to comment Share on other sites More sharing options...
Recommended Posts