thierry_02 Posted October 10, 2009 Share Posted October 10, 2009 Bonjour, je voudrais mettre a coté de la categorie le nombre article . Voir photo montage Je voudrais prendre le petit bout de code en bo pour le mettre sur le site.Si quel un peut me donner une idée,ou une piste merci. Link to comment Share on other sites More sharing options...
thierry_02 Posted October 13, 2009 Author Share Posted October 13, 2009 bonjour voila il ya une contrib pour ce que je cherche mes voila il indique le nombre de sous categorie et pas le nombre de produit voici le code si quelqun pourrer me dire ce que je doit chgt pour que ca marche merci.fichier category-tree-branch. tpl // exclude home category 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']; } et pour le fichier blockcategories.php // exclude home category 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']; } 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