zigojacko Posted February 6, 2012 Share Posted February 6, 2012 Can anyone advise how we can simply add the product count in the sidebar category links? I know there has been plenty of discussion on this in the forum previously but... a ) don't try and sell me a different module that does this, it should be an option for the default Prestashop categories module! b ) all the other tutorials don't work for Prestashop 1.4.6.2 that we're using (the code they instruct to change, isn't even found in the files) - plus, the person who made a free module for this, the SSL is broken on their website so it's impossible to even checkout with anything. Any help, greatly appreciated. It's frustrating that the core for Prestashop has overlooked some of the most basic fundamentals in ecommerce and the answer is to package them up in additional modules at a cost... Link to comment Share on other sites More sharing options...
bellini13 Posted February 6, 2012 Share Posted February 6, 2012 if you want it free and part of the base product, then you should submit a feature request using the bug tracker. Link to comment Share on other sites More sharing options...
dhada Posted February 16, 2012 Share Posted February 16, 2012 try the module in the attachment if this is what you need. blockcategories.zip Link to comment Share on other sites More sharing options...
Loc Nguyen Posted March 5, 2012 Share Posted March 5, 2012 try the module in the attachment if this is what you need. thanks so much, but i get an error: Notice: Undefined index: product_count in C:\wamp\www\prestashop\modules\blockcategories\blockcategories.php on line 151 please help me, how can i fix it. thanks, Link to comment Share on other sites More sharing options...
Loc Nguyen Posted March 8, 2012 Share Posted March 8, 2012 yeah, finnaly i have fixed it Link to comment Share on other sites More sharing options...
andreitipau Posted November 30, 2012 Share Posted November 30, 2012 Please tell us how did you fixed it! Link to comment Share on other sites More sharing options...
joseluismartisanmiguel Posted January 2, 2013 Share Posted January 2, 2013 Para solucionar el problema de que la variable no está declarada es necesario añadir las mismas condiciones en la function hookFooter To solve the problem that the variable is not declared is necessary to add the same conditions on the function hookFooter $resultParents = array(); $resultIds = array(); foreach ($result as &$row) { if($row['id_category'] != 1) { $result_product_count = Db::getInstance()->ExecuteS(' SELECT COUNT(ac.`id_product`) as totalProducts FROM `'._DB_PREFIX_.'category_product` ac LEFT JOIN `'._DB_PREFIX_.'product` p ON p.`id_product` = ac.`id_product` WHERE ac.`id_category` = '.$row['id_category'].' AND p.`active` = 1'); $row['product_count'] = $result_product_count[0]['totalProducts']; } $resultParents[$row['id_parent']][] = &$row; $resultIds[$row['id_category']] = &$row; } Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now