3

I am working on category collection, i find this link. Here

$helper = Mage::helper('catalog/category');

// sorted by name, fetched as collection
$categoriesCollection = $helper->getStoreCategories('name', true, false);

// sorted by name, fetched as array
$categoriesArray = $helper->getStoreCategories('name', false, false);

this lines of code are written but where store id is passed so that all category collection fetch.

0

1 Answer 1

3

This function will load all categories from the root category of your current store.

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

The store is loaded from the Mage::app()->getStore() function which will load the store based on a few settings.

If you do not pass an Id to the getStore function then it will load the current store.

$id = $this->_currentStore;

So whatever is your current store based on app initialization will be used in this function.

Not the answer you're looking for? Browse other questions tagged or ask your own question.