Get a list of store Categories


/ Published in: PHP
Save to your folder(s)

Return a list of all store Categories


Copy this code and paste it in your HTML
  1. $category = Mage::getModel('catalog/category');
  2. $tree = $category->getTreeModel();
  3. $tree->load();
  4.  
  5. $ids = $tree->getCollection()->getAllIds();
  6. $arr = array();
  7.  
  8. if ($ids){
  9. foreach ($ids as $id){
  10. $cat = Mage::getModel('catalog/category');
  11. $cat->load($id);
  12. var_dump($cat);
  13. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.