首页 > 代码库 > magento 获得root categories

magento 获得root categories

$root_id = Mage::app()->getStore()->getRootCategoryId();
$categories = Mage::getModel(‘catalog/category‘)->getCategories($root_id);

获得分类名称

foreach($categories as $sub_cat){
echo $sub_cat->getName();
}