Posted By

luxmedia on 06/26/12


Tagged

categories magento


Versions (?)

Get child categories in Magento


 / Published in: PHP
 

URL: http://blog.decryptweb.com/child-categories-magento/

One approach to get all child categories of a magento category.

  1. <?php
  2.  
  3. $category_model = Mage::getModel('catalog/category'); //get category model
  4. $_category = $category_model->load($categoryid); //$categoryid for which the child categories to be found
  5. $all_child_categories = $category_model->getResource()->getAllChildren($_category); //array consisting of all child categories id
  6.  
  7. ?>

Report this snippet  

You need to login to post a comment.