Thr*_*igh 4 visibility filter magento categories
如何才能获得前端可见的类别(包括在导航菜单中 - >设置为是).我有以下函数来获取类别名称和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;
}
Run Code Online (Sandbox Code Playgroud)
任何帮助,将不胜感激.