My categories and subcategories hierarchy to a product listing page :
- Products
- Refrigerator
- back-bar fridges
- Product listing(here)
- back-bar fridges
- Refrigerator
Now, what i'm trying to get is while i'm in product listing page i want to get all the parent categories and subcategories with respective links.
What i tried is :
$categories = Mage::getModel('catalog/category')->getCollection()
->addAttributeToSelect('*')
->addIsActiveFilter();
But this doesn't render in product listing page. So how can i get all the active categories and subcategories in product listing page their links that will take me to the respective category/subcategory page.