0 votes
1.2k views
in Magento by
Dear all,

Here is my silly question, which I know is easy for someone worked on magento already. I'm a noob sorry!

How can we get The Root Category In Magento with the code please?

- Akshay

1 Answer

0 votes
by
<?php
$rootCategoryId = Mage::app()->getStore()->getRootCategoryId();
$_category = Mage::getModel('catalog/category')->load($rootCategoryId);
// You can then get all of the top level categories using:
$_subcategories = $_category->getChildrenCategories();
?>

Related questions

0 votes
1 answer 1.2k views
0 votes
1 answer 1.3k views
0 votes
1 answer 1.2k views
asked Jun 29, 2016 in Magento by Mark Brown
0 votes
1 answer 1.1k views
asked Jun 13, 2016 in Magento by Don
+1 vote
1 answer 1.3k views
+1 vote
1 answer 1.7k views
...