I use the code below to show the categories that a product is in on my productpage. But i run multi-store with the same products and it is showing also the categories of the oth
User this code to get categories of current store.
$storeId = Mage::app()->getStore()->getStoreId();
$rootCategoryId = Mage::app()->getStore($storeId)->getRootCategoryId();
$categoriesCollection = Mage::getModel('catalog/category')
->getCollection()
->setStoreId($storeId)
->addFieldToFilter('is_active', 1)
->addAttributeToFilter('path', array('like' => "1/{$rootCategoryId}/%"))
->addAttributeToSelect('*');
foreach($categoriesCollection as $cat)
{
$id = $cat->getId();
$name = $cat->getName();
}