Jump to content

Show subcategories of a parent category


DARKF3D3

Recommended Posts

To show subcategories on page categories I used this code, added to the file file /catalog/listing/category.tpl

  {block name='category_subcategories'}
    <ASIDE class="hidden-sm-down clearfix">
      {if $subcategories|count}
        <NAV class="subcategories">
          <UL>
            {foreach from=$subcategories item="subcategory"}
              <LI>
                {block name='category_miniature'}
                  {include file='catalog/_partials/miniatures/category.tpl' category=$subcategory}
                {/block}
              </LI>
            {/foreach}
          </UL>
        </NAV>
      {/if}
    </ASIDE>
  {/block}

In this way all the subcategories of the actual category are showed.

But now I would like to show the same subcategories also when I'm on one of the subcategories of the parent category.

For example, with this category structure:

TECH

  >> SMARTPHONE

  >> TABLET

  >> NOTEBOOK

  >> DESKTOP COMPUTERS

I would like to show on all the 4 subcategories and also on the parent category TECH:

SMARTPHONE - TABLET - NOTEBOOK - DESKTOP COMPUTERS

 

It is possible to do this?

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...