Jump to content

[Solved] Remove text: There are ** products in category view


Recommended Posts

Change lines 5-15 of category.tpl in your theme's directory from:

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

       {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:

{strip}
   {$category->name|escape:'htmlall':'UTF-8'}
{*    
       {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}

Link to comment
Share on other sites

Rocky, I have been trying to remove the "there are no products" text as most of my items are in subcatergories...while I think most people will understand to click on the subs I would like to remove it and have seen a few tutorials but nothing seems to work.

I should be doing this in my themes catergories tpl correct?

Thanks for any help!

Link to comment
Share on other sites

I am not sure what I am doing wrong, nothing seems to work! I googled "comment out"...and I think I sort of understand it but how exactly do I do that...could I just change the text from "there are no products" to "choose a model below" ??

Tried editing everything and it makes no change...weird!!!

Link to comment
Share on other sites

To comment out code in TPL files, you add {* just before the code you want to comment out and *} at the end of the code you want to comment out. It should work if you are editing the right file. If that doesn't work, you can go to Tools > Translations > Front Office translations and search for "There are no products" and set the translation to "Choose a model below".

Link to comment
Share on other sites

This is what worked for me!

Change lines 5-15 of category.tpl in your theme's directory from:

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

       {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:

{strip}
   {$category->name|escape:'htmlall':'UTF-8'}
{*    
       {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}

Link to comment
Share on other sites

you can go to Tools > Translations > Front Office translations and search for "There are no products" and set the translation to "Choose a model below".



Thanks Rocky, much easier and worked great....gonna have to make another donation on your site! ;)

What is weird is at one point I completely REMOVED all the code from the catergory tpl files in both the default PS theme and my theme and nothing broke when I go back and view the site...that's not right is it?

I am doing this on xxamp on my computer, but I cleared cookies and cache and refreshed and the site and category functions as normal even after I deleted the tpl files...(since restored)

This is not normal behavior is it?

I am using notepad++ for editing of files.
Link to comment
Share on other sites

No, that is not normal. If you delete the entire contents of category.tpl, then the category pages should be blank. Do you have Smarty caching enabled? If so, then it takes one hour for the cache to be refreshed. Have you tried viewing your site on another computer or browser that hasn't viewed your site before?

Link to comment
Share on other sites

Only thing I changed the other day was this:

"however presta 1.3.1 has the force compile enabled by default so you will need to change manually

change $smarty->force_compile = true; to $smarty->force_compile = false; in config./smarty.config.inc.php"


As seen here:

http://www.prestashop.com/forums/viewthread/61160/general_discussion/1_dot_3_dot_1_is_slower_than_1_dot_2_

Would that affect it?

I did try checking it with another browser which also worked fine...I will check smarty caching...how should I have it configured before I put my site live?

Link to comment
Share on other sites

  • 4 months later...
To comment out code in TPL files, you add {* just before the code you want to comment out and *} at the end of the code you want to comment out. It should work if you are editing the right file. If that doesn't work, you can go to Tools > Translations > Front Office translations and search for "There are no products" and set the translation to "Choose a model below".


I've found that your suggestion on modifying the translation to be much easier than modifying code. I made a video to demonstrate how the changes are made in Translations. See http://www.prestashoptraining.com/11-remove-text-there-are-no-products.html. Enjoy!
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...