Jump to content

Targetting one category page to hide 'There are no products'


Recommended Posts

Hi,

I have a shopping tab that links to all main categories so you can then drill down to the products within that category.
I've achieved this by linking to /category.php?id_category=1

The issue I have is that it displays 'There are no products' as there aren't, but it gives the wrong impression. The title of the page is Home and the breadcrumbs show Home > Home. I want to hide these items for this page but I want to have them on other category pages.

So basicly i'm asking if there is a way to target these items just for this category page within the category.tpl page?

Link to comment
Share on other sites

Change lines 7-14 of category.tpl (in PrestaShop v1.3.2) from:


   {if $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}
{/strip}



to:

{if $smarty.get.id_category != 1}
   {if $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}
{/if}{/strip}

Link to comment
Share on other sites

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