Return to Snippet

Revision: 50019
at August 4, 2011 12:15 by slav123


Initial Code
private function getCategories() {
	$categories = Mage::getModel('catalog/category')
                    ->getCollection()
                    ->addAttributeToSelect('*')
                    ->addIsActiveFilter();
		
	$all = array();
	
	foreach ($categories as $c) {
	   $all[$c->getId()] = $c->getName();
	}
	
	return $all;
}

Initial URL


Initial Description


Initial Title
get all categories in magento

Initial Tags
magento

Initial Language
PHP