I am trying to pull category that belongs to current store only but it doesn\'t seem to work. Can anyone see any issue in my code?
$categoryCollection = Mage
In Magento 1.9
$storeId=2;
$rootCategoryId = Mage::app()->getStore($storeId)->getRootCategoryId();
$categories = Mage::getModel('catalog/category')
->getCollection()
->setStoreId($storeId)
->addFieldToFilter('is_active', 1)
->addAttributeToFilter('path', array('like' => "1/{$rootCategoryId}/%"))
->addAttributeToSelect('*');
foreach($categories as $categorie)
{
$catid=$cat->getId();
$catname=$categorie->getName();
$catp=catp$categorie->getParent_id();
}