Jump to content

[SOLVED] Remove "0" items from Category Title


Recommended Posts

Hi everyone,

First off, thanks in advance for anyone that can spare the time to take a look at this.

I have a large and deep folder structure in my Prestashop and as a result, when I am in a Sub category that only contains a new level of sub-categories, the Category Title (

) show's up as "0" items.

We are finding this to be quite confusing for customers as they believe there are no items in further in which is not the case.

I was hoping someone would be able to explain how I can remove the category title script that displays the number of items? It is ok if this is removed on all pages (even those that do have items) but we just need to ditch it for a standard title without highlighting how many items are directly in there.

Thank for anyone that takes a look at this.

Richard.

Link to comment
Share on other sites

Sorry all, got it done myself.

For anyone that looks at this looking for a solution.

1./ Open Category.tpl from your themes folder
2./ Remove line 7

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



Your code should now look like this from line 5 to line 7.


 {$category->name|escape:'htmlall':'UTF-8'}



WARNING: This removes item numbers from all Category Titles, even those that do contain items inside them.

Link to comment
Share on other sites

A better solution would be to change:

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



to:

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



This will hide the number of products only when there are no products.

Link to comment
Share on other sites

  • 3 months later...
  • 7 months later...

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