This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Usually, you can get category tree from category helper | |
$helper = Mage::helper('catalog/category'); | |
$nodes = $helper->getStoreCategories(); | |
// return Varien_Data_Tree_Node_Collection | |
// via Mage_Catalog_Model_Resource_Category | |
// However, this get method return active category only. | |
// Most of the samples are for collection of the category. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
define('MAGENTO', realpath(dirname(__FILE__))); | |
require_once MAGENTO . '/app/Mage.php'; | |
Mage::app(); | |
$category = Mage::getModel('catalog/category'); | |
$tree = $category->getTreeModel(); | |
$tree->load(); |