Jump to content

[Solved] Hiding Subcategories Above Products


Recommended Posts

I want the subcategories to show in the menu, but I do not want them to show on the actual category page. Or optionally, I would like to have the subcategories be smaller or just text links on the page. Where do I go to alter them and how to I hide them or alter them?

Ne'

Link to comment
Share on other sites

  • 1 year later...

this isn't working for me. I put in your code and it removed the entire subcategory.
this is my category.tpl file.

{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 $scenes}
       <!-- Scenes -->
       {include file=$tpl_dir./scenes.tpl scenes=$scenes}
   {else}
       <!-- Category image -->
       {if $category->id_image}
getCatImageLink($category->link_rewrite, $category->id_image, 'category')}" alt="{$category->name|escape:'htmlall':'UTF-8'}" title="{$category->name|escape:'htmlall':'UTF-8'}" id="categoryImage" />
       {/if}
   {/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

×
×
  • Create New...