Webkul
Services
Technologies Bagisto QloApps
iOS Android SAP BigCommerce Wix
Trusted by
Samsung Intel Toyota Walmart Disney Nokia Nestlé Decathlon
See all customers
Back to Top
DOC

Category Listing in Magento

Category Listing in Magento : Category listing is very common and useful for all the magento information .Many time magento developers needs this information . So here i’ll explain to get all the categories and subcategories in magento.Open the phtml file of the magento (where you want the listing ) and add the following code

$MainCat = Mage::getModel(‘catalog/category’)->load(3)->getChildren();
$cats=explode(“,”,$MainCat);

foreach($cats as $opt)
{
$catname=Mage::getModel(‘catalog/category’)->load($opt);

?>
<?php echo $catname->getName();?>

<?php
}

. . .

Leave a Comment

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


Be the first to comment.

Back to Top

Message Sent!

If you have more details or questions, you can reply to the received confirmation email.

Back to Home