Created
October 3, 2013 05:14
-
-
Save wcodex/6805307 to your computer and use it in GitHub Desktop.
How to get all Categories in Magento
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php $_helper = Mage::helper('catalog/category') ?> | |
<?php $_categories = $_helper->getStoreCategories() ?> <?php if (count($_categories) > 0): ?> | |
<ul> <?php foreach($_categories as $_category): ?> | |
<li> <a href="<?php echo $_helper->getCategoryUrl($_category) ?>"> | |
<span><?php echo $_category->getName() ?> </span> | |
</a> | |
</li> | |
<?php endforeach; ?> | |
</ul> | |
<?php endif; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment