Get The Root Category In Magento

0 votes
446 views
asked Jun 29, 2016 in Magento by Akshay Raj
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 Jul 8, 2016 by Robin Porter
<?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 384 views
0 votes
1 answer 547 views
0 votes
1 answer 365 views
asked Jun 29, 2016 in Magento by Mark Brown
0 votes
1 answer 347 views
asked Jun 13, 2016 in Magento by Don
0 votes
1 answer 247 views
+1 vote
1 answer 589 views
...