getId(); if (Mage::registry('hmenu_levels') !== 'one level' || Mage::registry('hmenu_responsive_levels') !== 'one level') { $_subcategories = Mage::getModel('catalog/category')->getCollection() ->setStoreId(Mage::app()->getStore()->getId()) ->addAttributeToSelect('*') ->addAttributeToFilter('is_active','1') ->addAttributeToFilter('include_in_menu','1') ->addAttributeToFilter('parent_id', array('eq' => $_categoryId)) ->addAttributeToSort('position') ->load(); $_thirdLevel = Mage::getModel('catalog/category')->getCollection() ->setStoreId(Mage::app()->getStore()->getId()) ->addAttributeToSelect('*') ->addAttributeToFilter('is_active','1') ->addAttributeToFilter('include_in_menu','1') ->addAttributeToFilter('parent_id', array('in' => $_subcategories->getAllIds())); } $_hasSubcategories = $_subcategories && $_subcategories->count(); $_hasThirdLevel = $_thirdLevel && $_thirdLevel->count(); $_itemMegaOption = null; if (Mage::registry('hmenu_levels') === 'megamenu') { $_itemMegaOption = empty($_megaMenu[$_categoryId]) ? array( 'status' => Billiondigital_Theme_Model_Settings_Menu::MEGA_AUTO, 'width' => Billiondigital_Theme_Model_Settings_Menu::MEGA_SHEET_WIDTH, 'customWidth' => '' ) : $_megaMenu[$_categoryId]; switch ((int) $_itemMegaOption['width']) { case Billiondigital_Theme_Model_Settings_Menu::MEGA_DEFAULT_WIDTH: $_itemMegaOption['width'] = 'default'; break; case Billiondigital_Theme_Model_Settings_Menu::MEGA_SHEET_WIDTH: $_itemMegaOption['width'] = 'sheet'; break; case Billiondigital_Theme_Model_Settings_Menu::MEGA_CUSTOM_WIDTH: $_itemMegaOption['width'] = 'custom'; break; } $_hasMegamenu = (!count($_megaMenu) || (int) $_itemMegaOption['status'] === Billiondigital_Theme_Model_Settings_Menu::MEGA_AUTO) && $_hasSubcategories && $_hasThirdLevel; } ?>