Jump to content

show number of products next to subcat in custom template


Recommended Posts

I have a custom template called products-categories.tpl, listing all main subcategories, which link to subcategory page with list of products. I would like to show a number of products each subcategory has in this custom template, but I am not sure how to do this.

There is a variable called $nb_products in CategoryController and the code for it is:

$nbProducts = $this->category->getProducts(NULL, NULL, NULL, $this->orderBy, $this->orderWay, true);
                   self::$smarty->assign('nb_products', (int)$nbProducts);
                   $cat_products = $this->category->getProducts((int)(self::$cookie->id_lang), (int)($this->p), (int)($this->n), $this->orderBy, $this->orderWay);


Anybody knows what code would I have to put in my custom template controller so that I could display a number of products next to each subcategory?

Any help would be really appreciated.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...