How can I get only the categories visible in the external interface (Enable in the navigation menu → set to "Yes"). I have the following function to get the names and URLs of categories.
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; }
Any help would be appreciated.
source share