I want to show my parent category and all its sub-categories, whenever I visit one of those category pages.
I want a structure like this on all the Ralph Lauren categories;
- Ralph Lauren
- T-shirts
- Pants
- Jackets
But this only shows when I visit the parent category Ralph Lauren. If I click on T-shirt it doesn't show any other categories, since Ralph Lauren T-shirts doesn't have any children.
How can I achieve that?
<div class="magicat-container">
<div class="block">
<div class="block-title cat_heading">
<strong><span><?php echo Mage::registry('current_category')->getName(); ?></span></strong>
</div>
<?php
$store_categories = $this->toLinearArray($this->getStoreCategories());
if ($count = count($store_categories))
echo '<ul id="magicat">';
foreach ($store_categories as $i => $_category)
{
$class = array() ;
if ($count == 1)
$class[] = 'only';
else if(!$i)
$class[] = 'first';
else if ($i == $count-1)
$class[] = 'last';
if (isset($store_categories[$i+1]) && $this->isCategoryActive($store_categories[$i+1]))
$class[] = 'prev';
if (isset($store_categories[$i-1]) && $this->isCategoryActive($store_categories[$i-1]))
$class[] = 'next';
echo $this->drawOpenCategoryItem($_category, 0, $class);
}
if ($count)
echo '</ul>';
?>
</div>
</div>
product/list.phtml
page ? I am asking about the above code