Guest User

Untitled

a guest
Mar 20th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. Mage::getResourceSingleton('catalog/category_tree')->load();
  2.  
  3. $tree = Mage::getResourceSingleton('catalog/category_tree')->load();
  4. $root = $tree->getNodeById($rootCategoryId);
  5. if($root && $root->getId() == 1) {
  6. $root->setName(Mage::helper('catalog')->__('Root'));
  7. }
  8. $collection = Mage::getModel('catalog/category')->getCollection()
  9. ->addAttributeToSelect('name')
  10. ->addAttributeToFilter('is_active','1');
  11. //->addAttributeToFilter('display_mode',array('nlike'=>'PAGE'))
  12. //->setLoadProductCount(true)
  13. //->setProductStoreId($store)
  14. //->addAttributeToFilter('include_in_menu','1');
  15.  
  16. $tree->addCollectionData($collection, true);
Add Comment
Please, Sign In to add comment