How to get root category using store id.
we get store id using $storeId = $this->getStoreId();
We use below code for get root category using store id; but we get wrong.
$rootCat = $this->_storeManager->getStore($storeId)->getRootCategoryId();
Any one help us for solve this.
Best Answer
You can use
\Magento\Store\Model\StoreManagerInterface
class to get store default root category Id.