DavyAgten Posted November 16, 2011 Share Posted November 16, 2011 Hello How can i put the number of products next to each subcategory? With this we count the number of products in the category: {if $category->id == 1 OR $nb_products == 0}{l s='There are no products.'} {else} {if $nb_products == 1}{l s='There is'}{else}{l s='There are'}{/if} {$nb_products} {if $nb_products == 1}{l s='product.'}{else}{l s='products.'}{/if} {/if} But i also have subcategories and i want the number of items in the subcategories next to the subcategory image. Can anyone help me? Thx Link to comment Share on other sites More sharing options...
DavyAgten Posted November 17, 2011 Author Share Posted November 17, 2011 Nobody to the rescue? Link to comment Share on other sites More sharing options...
DavyAgten Posted November 18, 2011 Author Share Posted November 18, 2011 Please? Link to comment Share on other sites More sharing options...
DavyAgten Posted November 21, 2011 Author Share Posted November 21, 2011 Maybe lucky today? Link to comment Share on other sites More sharing options...
evolution.x Posted February 6, 2012 Share Posted February 6, 2012 Maybe lucky today? Did you find a solution to your problem? I need the exact same thing Link to comment Share on other sites More sharing options...
sixthmind Posted April 18, 2012 Share Posted April 18, 2012 Did anybody find a solution yet? or anybody know how to do this? Link to comment Share on other sites More sharing options...
sixthmind Posted April 18, 2012 Share Posted April 18, 2012 Under classes/category.php, I found that we have a function: * @param integer $id_lang Language ID * @param integer $p Page number * @param integer $n Number of products per page * @param boolean[b] $getTotal return the number of results instead of the results themself[/b] * @param boolean $active return only active products * @param boolean $random active a random filter for returned products public function getProducts($id_lang, $p, $n, $orderBy = NULL, $orderWay = NULL, [b]$getTotal = false[/b], $active = true, $random = false, $randomNumberProducts = 1, $checkAccess = true) I wonder if there is a way of using this function to produce number of products under each subcategory? what code would we have to put into an override of CategoryController.php ? 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