Posted By

slav123 on 08/04/11


Tagged

magento


Versions (?)

get all categories in magento


 / Published in: PHP
 

  1. private function getCategories() {
  2. $categories = Mage::getModel('catalog/category')
  3. ->getCollection()
  4. ->addAttributeToSelect('*')
  5. ->addIsActiveFilter();
  6.  
  7. $all = array();
  8.  
  9. foreach ($categories as $c) {
  10. $all[$c->getId()] = $c->getName();
  11. }
  12.  
  13. return $all;
  14. }

Report this snippet  

You need to login to post a comment.