Magento Category Collection – Get Category Collection from Specific Store

catalogcategory

With flat tables turned off, how can I get a category collection from a specific store view ?

I have tried the following:

Mage::getModel('catalog/category')->getCollection()->setStoreId(3);

But it only returns the collection for the default store?

What is not correct with my example?

Best Answer

Instead of store filter, try with root category filter.

$rootcatID = Mage::app()->getStore()->getRootCategoryId();

$productCollection = Mage::getResourceModel('catalog/product_collection')
->joinField('category_id','catalog/category_product','category_id','product_id=entity_id',null,'left')
->addAttributeToFilter('category_id', array('in' => $rootcatID))
->addAttributeToSelect('*');

$productCollection->load();