0 votes
526 views
asked 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
answered 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 421 views
0 votes
1 answer 774 views
0 votes
1 answer 477 views
asked Jun 29, 2016 in Magento by Mark Brown
0 votes
1 answer 403 views
asked Jun 12, 2016 in Magento by Don
0 votes
1 answer 343 views
+1 vote
1 answer 728 views
...