如何才能获得前端可见的类别(包含在导航菜单中 - >设置为是)。我有以下函数来获取类别名称和URL。
function getCatLinks($id){
$_model = Mage::getModel('catalog/category');
$cats = $_model->load($id)->getChildren();
$catIds = explode(',',$cats);
$categories = array();
foreach($catIds as $catId) {
$category = $_model->load($catId);
if( $category->getIsActive() ) {
$categories[$category->getName()] = $category->getUrl();
}
}
ksort($categories, SORT_STRING);
return $categories;
}
任何帮助都将不胜感激。
答案 0 :(得分:6)
我想你需要:
$category->getIncludeInMenu();