Universal WebTech
  • Home
  • About US
    • Our Team
    • Privacy Policy
    • Our Clients
    • Terms of use
  • Service
    • Web Development
    • E-Commerce
    • Android Development
    • UI UX Design
  • Our Portfolio
  • Career
  • Blogs
contact
hamburger

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();
}

Universal WebTech

Universal WebTech IT Solutions is a leading web and mobile development company in Ahmedabad, India that believes in winning trust of its clients through 100% quality service and time-oriented work.

Company

  • About us
  • Careers
  • FAQs
  • Testimonials
  • Blogs
  • Our team

Service

  • Web Development
  • Android Application Development
  • eCommerce Web Development
  • Open Source Customization
  • UI / UX / Logo Design Services

Copyright © 2025 Universal WebTech

  • Terms of use
  • Privacy Policy