In my website I have a default menu which always shows in the header part. Now I want to add another root category which will show up in a specific page(not all pages). I already created a new root category from magento admin but don't know how to show only this category in frontend. point that my new category id is '12' I tried
<?php
$category = Mage::getModel('catalog/category');
$tree=$category->getTreeModel();
$tree->load();
$ids = $tree->getCollection()->getAllIds();
$arr = array();
if ($ids){
foreach ($ids as $id){
$cat = Mage::getModel('catalog/category');
$cat->load($id);
$arr[$id]=$cat->getName();
}
}
?>
<?php
$cat_id = Mage::app()->getStore()->getRootCategoryId();
$collection = Mage::getModel('catalog/category')->getCategories($cat_id,12, true, true);
$position=array();
$index=array();
foreach($collection as $key=>$cat) {
array_push($index,$cat->getPosition());
}
asort($index);
echo '<ul class="jetmenu blue">';
$c=0;
foreach($index as $index_new){
foreach($collection as $cat){
if( $index_new==$cat->getPosition())
{
echo '<li><a href="'.$cat->getURL().'" />'.$cat->getName().'</a>';
$cat_id=$cat->getId();
$subcategory_html=GetSubcategory($cat_id);
echo $subcategory_html;
echo '</li>';
}
}
}
?>
</ul>
but this only shows the default category, not the other category.