Jump to content

Category heading shows 'Zero' products even thou sub cats have products - How do I change this


gray

Recommended Posts

I want the category heading to show a total number of all products, in all of its sub categorys.

At present it puts people off, as it gives the impression that there are no products in the category.


had the same issue and as 'final workaround' just deleted the total # of products completely. in my book it does not add any benefit anyway to know how many products are in a category. and might even look silly if it's just 3 or 4.....

phil
Link to comment
Share on other sites

I know what you mean, but as I have been used to other shopping carts, where this is a normal feature I would like to retain it.

I can see from ../themes/prestashop/category.tpl that

{$nb_products|intval} {if $nb_products>1}{l s='products'}{else}{l s='product'}{/if}

But this only seems to look at products one level below the current, and not at all levels

And I can see that nb_products is defined in ../category.php as

{
$nbProducts = $category->getProducts(NULL, NULL, NULL, $orderBy, $orderWay, true);
include(dirname(__FILE__).'/pagination.php');
$smarty->assign('nb_products', $nbProducts);
$cat_products = $category->getProducts(intval($cookie->id_lang), intval($p), intval($n), $orderBy, $orderWay);
}

Now this where I get a bit lost. Any help from here on plz.

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...