0

Suppose below is my hierarchy :

Default Category
    Women  (30)
    Men  (50)
    Accessories (25)

Now I want to display women,men and Accessories category in left navigation menu.These categories has not any child categories,just have products.

3
  • are you want to show this filter depends on current apply filter
    – Amit Bera
    Jun 29, 2015 at 6:19
  • Sorry but am not getting you. Jun 29, 2015 at 6:25
  • **manage store -> click the link->storename(select parant category) ** Jun 29, 2015 at 6:42

1 Answer 1

1

Try this code:-

app/design/frontend/default/your-bespoke-design-template/template/catalog/navigation/leftnav.phtml

<?php
    $currentCat = Mage::registry('current_category');

    if ( $currentCat->getParentId() == Mage::app()->getStore()->getRootCategoryId() )
    {
        // current category is a toplevel category
        $loadCategory = $currentCat;
    }
    else
    {
        // current category is a sub-(or subsub-, etc...)category of a toplevel category
        // load the parent category of the current category
        $loadCategory = Mage::getModel('catalog/category')->load($currentCat->getParentId());
    }
    $subCategories = explode(',', $loadCategory->getChildren());

    foreach ( $subCategories as $subCategoryId )
    {
        $cat = Mage::getModel('catalog/category')->load($subCategoryId);

        if($cat->getIsActive())
        {
            echo '<a href="'.$cat->getURL().'">'.$cat->getName().'</a>';
        }
    }
?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.