Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find root category of store

Tags:

magento

I am using Magento ver1.6.1. I need to get the root category of a store. I search in google by didn't get any good idea/code. Let me know how to get the root category of a store?

Mage::app()->getStore()->getRootCategoryId()

The above code gives the default root category, but I need the category Id which we select during store creation.

like image 726
Sankar Subburaj Avatar asked Jan 02 '12 12:01

Sankar Subburaj


People also ask

How do I get root category in Magento 2?

You can get the root category ID in Magento 2 by calling the getRootCateogryId() function in the phtml file.

What is the category of root?

Plants have three types of root systems: 1.) taproot, with a main taproot that is larger and grows faster than the branch roots; 2.) fibrous, with all roots about the same size; 3.) adventitious, roots that form on any plant part other than the roots.

What is Magento 2?

Magento 2 is an open-source E-commerce platform, which is created by Roy Rubin and Yoav Kutner under Varien Inc. Magento was first released on March 31, 2007. It is a useful software for the online business, and currently a largest E-commerce platform in the world. Magento 2 is very simple, versatile, and quick to use.


1 Answers

have you tried:

Mage::app()->getStore($storeId)->getRootCategoryId();
like image 186
Anton S Avatar answered Oct 11 '22 21:10

Anton S