Get list of main Category on product listing page by passing default category ID
************************************************************************
<?php
$parentCategoryId = 2;
$children = Mage::getModel('catalog/category')->getCategories($parentCategoryId);
foreach ($children as $category) { ?>
<li><a href="<?php echo $category->getURL(); ?>"><?php echo $category->getName(); ?></a></li>
<?php
}
?>
************************************************************************
************************************************************************
<?php
$parentCategoryId = 2;
$children = Mage::getModel('catalog/category')->getCategories($parentCategoryId);
foreach ($children as $category) { ?>
<li><a href="<?php echo $category->getURL(); ?>"><?php echo $category->getName(); ?></a></li>
<?php
}
?>
************************************************************************
No comments:
Post a Comment