Custom Menu In Magento

<?php

        $root_category = Mage::getModel(‘catalog/category’)->load(3); // Put your root category ID here.

        $subcategories = $root_category->getChildren();

  foreach(explode(‘,’,$subcategories) as $subcategory) {

        $category = Mage::getModel(‘catalog/category’)->load($subcategory);

        echo ‘<a href=”‘.$category->getURL() .'” />’.$category->getName().'</a><br/>’;

  }

  ?>

0

Leave a Reply

Your email address will not be published.
You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>