Showing posts with label setStoreId. Show all posts
Showing posts with label setStoreId. Show all posts

2014-08-07

Filter categories by store

Getting categories from specific store:
$storeId = 5;
$categoryId = Mage::app()->getStore($storeId)->getRootCategoryId();
$categories = Mage::getModel('catalog/category')->getCollection()
->addFieldToFilter('path', array('like'=> "1/$categoryId/%"))