//获取所有激活状态的分类模型集合 标签:category,填充,allCategory,分类,导出,Magento,数组,ID From: https://blog.51cto.com/u_5112239/5948305
$categories = Mage::getModel( 'catalog/category' )->getCollection()
->addAttributeToSelect( '*' )
->addIsActiveFilter();
//循环Collection,并填充数组,可以根据需要的数据进行填充,本例以分类ID作为key,对应的值作为value
$allCategory = array ();
foreach ( $allCategory as $category ) {
$all [ $category ->getId()] = $category ->getName();
}
return $allCategory ;
}