Skip to content

Instantly share code, notes, and snippets.

@wcodex
Created October 3, 2013 05:14
Show Gist options
  • Save wcodex/6805307 to your computer and use it in GitHub Desktop.
Save wcodex/6805307 to your computer and use it in GitHub Desktop.
How to get all Categories in Magento
<?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