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);?>
echo $category->
getName()?></
a></
li>
<?php }?>
</ul>
this will help you new root category get child cateogry check it
if you want to add new root category in your menu then
just do and follow step
Go to Admin -> Catalog -> Manage Categories -> "Select Category" -> Display Settings -> Is Anchor = "Yes"
Then:
Admin -> System -> Index Management -> "Select All" -> "Reindex data" -> "Submit"
get defualt root category any where
Mage::app()->getStore("default")->getRootCategoryId()
any new root category then
Mage::app()->getStore($storeId)->getRootCategoryId();
Related Posts
- Change product list page template in magento
- Usefull Link For Php,magento,Jquery,css,Bootsrap
- Layout handle for product grid and list view in magento
- magento Get Base Url , Skin Url , Media Url , Js Url , Store Url and Current Url ,home url , module url , drirectory url userfull reference for magento
- Magento Product Addtocart go to Checkout Page by skipping Cart Page
- Set your custom temple in your cms page or using xml file magento
- add class in body tag in all page in magento
- Get Product attribute’s select option Id or Lable or Value in Magento
- remove index.php in url in magento
- Magento secure url Secure/Unsecure Link - Link Securely for Secure Pages only
- Create new custom category attribute in Magento
- Magento Add to cart quantity increment/decrement quantity with jQuery
- How to add static block call in phtml,xml and cms page in magento
- Change products per page for individual categories in magento
- how to create magento static block
0 komentar:
Post a Comment