Jump to content

[SOLVED] How to hide number of products


Recommended Posts

I have a category called Silver Rings. Under this category I have 2 sub-categories, Silver Rings with stone and Silver Rings without stone. I have several products under both of these sub-categories but not under the category "Silver Rings" itself.
However when I click on the category "Silver Rings" it takes me to the page that displays the sub-categories and their images. On this page next to the category title, I can see "Products 0". I think this could be quite misleading to some of my customers. How can I get rid of this from this page?

Link to comment
Share on other sites

Hi rocky,
Following is the code from my category.tpl and I do not see the code that you mentioned

{include file=$tpl_dir./breadcrumb.tpl} 
{include file=$tpl_dir./errors.tpl}

{if $category->id AND $category->active}

       {$category->name|escape:'htmlall':'UTF-8'}
{$nb_products|intval} {if $nb_products>1}{l s='products'}{else}{l s='product'}{/if}




   {if $category->description}
{$category->description}
   {/if}
   {if isset($subcategories)}
   <!-- Subcategories -->

{l s='Subcategories'}

       {foreach from=$subcategories item=subcategory}

getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}" title="{$subcategory.name|escape:'htmlall':'UTF-8'}">
                   {if $subcategory.id_image}
getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'medium')}" alt="" />
                   {else}

                   {/if}



getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}">{$subcategory.name|escape:'htmlall':'UTF-8'}

       {/foreach}




   {/if}

   {if $products}
           {include file=$tpl_dir./product-sort.tpl}
           {include file=$tpl_dir./product-list.tpl products=$products}
           {include file=$tpl_dir./pagination.tpl}
       {elseif !isset($subcategories)}

{l s='There is no product in this category.'}
       {/if}
{elseif $category->id}

{l s='This category is currently unavailable.'}
{/if}

Link to comment
Share on other sites

It looks like you are using a PrestaShop v1.2.5 theme. In that case, change line 7 from:

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



to:

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

Link to comment
Share on other sites

  • 3 weeks later...
It looks like you are using a PrestaShop v1.2.5 theme. In that case, change line 7 from:

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



to:

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



ok this work but if i want delete number of products from all pages in prestashop what i must do?
Link to comment
Share on other sites

  • 1 year later...
×
×
  • Create New...