donnie1992 Posted September 19, 2013 Share Posted September 19, 2013 Hi, Im basically have a small issue regarding the displaying of categorys. I have a category with several Sub-categories wich have the products in them. The main category does not have any products. If i look at the category page on the front end it displays the error: "There are no products" I looked online an i found this fix: Solution 2. Make some changes make above "There are no products." only appear when the category is empty and also there is no sub-category. Please make change at file /themes/yourtheme/category.tpl Replace this line {if $nb_products == 0}{l s='There are no products.'} with following 4 lines {if $nb_products == 0} {if !isset($subcategories)} {l s='There are no products.'} {/if} But unfortunatly the code in 1.5.x changed so it's no longer there. Any idea on how to change it? 1 Link to comment Share on other sites More sharing options...
bside2234 Posted September 20, 2013 Share Posted September 20, 2013 (edited) It's now in the category-count.tpl I believe. Edit: Just tried it and it worked fine. Edited September 20, 2013 by bside2234 (see edit history) Link to comment Share on other sites More sharing options...
donnie1992 Posted September 21, 2013 Author Share Posted September 21, 2013 It's now in the category-count.tpl I believe. Edit: Just tried it and it worked fine. What do you mean? How can i remove the count on just that category? The category count code seems to check if the category has a id of 1 wich im guessing means it checks if it's a main category, wich i enabled. but it still shows that there are no products,. Link to comment Share on other sites More sharing options...
vekia Posted September 21, 2013 Share Posted September 21, 2013 open file category-count.tpl there is a code: {if $category->id == 1 OR $nb_products == 0} {l s='There are no products in this category'} {else} {if $nb_products == 1} {l s='There is %d product.' sprintf=$nb_products} {else} {l s='There are %d products.' sprintf=$nb_products} {/if} {/if} change it to: {if $category->id == 1 OR $nb_products == 0} {if !isset($subcategories)} {l s='There are no products in this category'} {/if} {else} {if $nb_products == 1} {l s='There is %d product.' sprintf=$nb_products} {else} {l s='There are %d products.' sprintf=$nb_products} {/if} {/if} 1 Link to comment Share on other sites More sharing options...
maximo88 Posted October 20, 2013 Share Posted October 20, 2013 (edited) SOLUTION IN THE BOTTOM This is a cheap fix We want that it counts all the products in subcategories. I bought this template http://www.templatemonster.com/prestashop-themes/45052.html It counts on 1.5.4 all. It said "There are 1700 products" and they appear on the bottom of the web. But 1.5.5 and 1.5.6 doesn't count Edited October 21, 2013 by maximo88 (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted October 21, 2013 Share Posted October 21, 2013 as far as i know everything depends on your products configuration. product have to be associated with category to be counted there. by default system doesn't count products in subcategories if products aren't attached to "main" category too. 1 Link to comment Share on other sites More sharing options...
maximo88 Posted October 21, 2013 Share Posted October 21, 2013 I have discovered it. Thank you for your help. When you activate block layered, you can select view subcategory products on category. That is the trick. I have activaded and desactivated, it not was a problem of versions in prestashop Link to comment Share on other sites More sharing options...
marsverh Posted September 10, 2015 Share Posted September 10, 2015 open file category-count.tpl there is a code: {if $category->id == 1 OR $nb_products == 0} {l s='There are no products in this category'} {else} {if $nb_products == 1} {l s='There is %d product.' sprintf=$nb_products} {else} {l s='There are %d products.' sprintf=$nb_products} {/if} {/if} change it to: {if $category->id == 1 OR $nb_products == 0} {if !isset($subcategories)} {l s='There are no products in this category'} {/if} {else} {if $nb_products == 1} {l s='There is %d product.' sprintf=$nb_products} {else} {l s='There are %d products.' sprintf=$nb_products} {/if} {/if} Hello this code doesn't seems to work in version 1.6.1.1 I still keeping "There are no ...." i changed the default en my template in use... I don't have any products in the category only in subcategories. Structure Home -- Main cat -- sub cat Link to comment Share on other sites More sharing options...
Recommended Posts