Get subcategories of a main category in magento

To insincere sales it is important that your store must be user friendly where user easily find his/ her needed product and easily navigate in store.

one of important page in magento is to display subcategory of main category. i.e let\’s assume we have store with category Women and we are selling all products which was related to women so it is preferable if we bifurcate all products so customer can easily find product.

Below is the code for display all sub-category of parent category.

$layerobject = Mage::getSingleton('catalog/layer');
$_category = $layerobject->getCurrentCategory();
$currentCategoryId= $_category->getId();
$childrencategory = Mage::getModel('catalog/category')->getCategories($currentCategoryId);
foreach ($childrencategory as $category)
{
echo $category->getName();
echo $category->getRequestPath();
}

Tags: Magento1,

Related Posts

No comments

Leave a Reply

Your email address will not be published. Required fields are marked *