Rockstar2 Posted July 2, 2010 Share Posted July 2, 2010 How can remove or disable this text when a person views a category? I don't want them to know how many products are in the store. Link to comment Share on other sites More sharing options...
rocky Posted July 3, 2010 Share Posted July 3, 2010 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 More sharing options...
glenns Posted July 3, 2010 Share Posted July 3, 2010 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 More sharing options...
rocky Posted July 3, 2010 Share Posted July 3, 2010 In that case, {* comment out *} lines 57-59 of category.tpl: {elseif !isset($subcategories)} {l s='There are no products in this category.'} {/if} Link to comment Share on other sites More sharing options...
glenns Posted July 3, 2010 Share Posted July 3, 2010 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 More sharing options...
rocky Posted July 3, 2010 Share Posted July 3, 2010 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 More sharing options...
Rockstar2 Posted July 3, 2010 Author Share Posted July 3, 2010 Yes this worked, thanks! Link to comment Share on other sites More sharing options...
Rockstar2 Posted July 3, 2010 Author Share Posted July 3, 2010 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 More sharing options...
glenns Posted July 3, 2010 Share Posted July 3, 2010 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 More sharing options...
rocky Posted July 3, 2010 Share Posted July 3, 2010 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 More sharing options...
glenns Posted July 4, 2010 Share Posted July 4, 2010 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 manuallychange $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 More sharing options...
rocky Posted July 4, 2010 Share Posted July 4, 2010 Yes, that would stop your templates from being compiled. You should turn "force_compile" back on until you've finished editing your templates. Link to comment Share on other sites More sharing options...
glenns Posted July 4, 2010 Share Posted July 4, 2010 Cheers Rocky!!! Link to comment Share on other sites More sharing options...
curtdonohue Posted November 8, 2010 Share Posted November 8, 2010 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now