Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get sub-categories of a specific parent category?

Tags:

magento

I had a main category (parent category) whose id = 10. I want to echo just its sub-categories. How can I do that?

like image 410
atif Avatar asked Sep 11 '25 04:09

atif


1 Answers

$children = Mage::getModel('catalog/category')->getCategories(10);
foreach ($children as $category) {
    echo $category->getName();
}
like image 58
clockworkgeek Avatar answered Sep 13 '25 12:09

clockworkgeek



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!