Tag : categories

Magento get all categories

Here is a sample code to extract all categories from magento database:


$collection = Mage::getModel('catalog/category')-<getCollection()-<addAttributeToSelect("name");
$catIds = $collection-<getAllIds();
$cat = Mage::getModel('catalog/category');
foreach ($catIds as $catId) {
$category = $cat-<load($catId);
print $category-<getName() . "
";
}