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:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
/** * Get category name * * @param Varien_Object $node * @return string */ public function buildNodeName($node) { $result = $this->escapeHtml($node->getName()); if ($this->_withProductCount) { $result .= ' (' . $node->getProductCount() . ')'. ' [' . $node -> getId() . ']'; #Alternative: $result .= ' [' . $node -> getId() . '] (' . $node->getProductCount() . ')'; #Alternative: $result = "[{$node -> getId()}] {$this->escapeHtml($node->getName())} ({$node->getProductCount()})"; } return $result; } |
The important part is . ' [' . $node -> getId() . ']' in line eleven.