Categories of store other than running store in Magento


Sometimes there is need to display categories of store other than running store in Magento.

Below code will achieve it to get categories of store other than running store.

getStore($storeId)->getRootCategoryId();
 
$category_model = Mage::getModel('catalog/category');
 
$_category = $category_model->load($root_cat); // category id for which the child categories to be found
$all_child_categories = $category_model->getResource()->getAllChildren($_category); //array consisting of all child categories id
echo '
';
print_r($all_child_categories);
echo '
'; ?>