Back to Top

Category Listing in Magento

Updated 19 May 2017

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
}

Searching for an experienced
Magento Company ?
Find out More
. . .

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