Get all Root-Category-IDs of all stores

This snippet gives you all entity_id’s of all Root-IDs of the Magento instance: /** * @return array Root-IDs of all stores */ public function getAllRootIds(){# $aRootIds = array(); $aRootIds[Mage_Catalog_Model_Category::TREE_ROOT_ID] = Mage_Catalog_Model_Category::TREE_ROOT_ID; $aAllStores = Mage::app()->getStores(); foreach ($aAllStores as $iID => $store){ $rootID = $store->getRootCategoryId(); $aRootIds[$rootID]=$rootID; } return array_keys($aRootIds); }  

Magento – Put Category-IDs into category tree in backend

To show the category IDs in the category tree under Catalog->Categories->Manage Categories you can rewrite Mage_Adminhtml_Block_Catalog_Category_Tree in an own module. You have to rewrite the method buildNodeName like this: /** * Get category name * * @param Varien_Object $node * @return string */ public function buildNodeName($node) { $result = $this->escapeHtml($node->getName()); if ($this->_withProductCount) { $result .= ‘ (‘ . $node->getProductCount() […]