how to get new root category of sub category in magento
$root_category = Mage:: getModel ( 'catalog/category') ->load( 7); // Put your root category ID here.
$subcategories = $root_category->getChildren ( );?>
<ul class="cat_list">
<? php foreach( explode( ',', $subcategories) as $subcategory) {
$category = Mage:: getModel ( 'catalog/category') ->load( $subcategory);?>
<? php } ?>
</ul >
Go to Admin -> Catalog -> Manage Categories -> "Select Category" -> Display Settings -> Is Anchor = "Yes"
Then:
Admin -> System -> Index Management -> "Select All" -> "Reindex data" -> "Submit"
0 komentar:
Post a Comment