diff --git a/blocktopmenu.php b/blocktopmenu.php index 128066d..7186de2 100644 --- a/blocktopmenu.php +++ b/blocktopmenu.php @@ -479,7 +479,7 @@ class Blocktopmenu extends Module switch (substr($item, 0, strlen($value[1]))) { case 'CAT': - $this->_menu .= $this->generateCategoriesMenu(Category::getNestedCategories($id, $id_lang, true, $this->user_groups)); + $this->_menu .= $this->generateCategoriesMenu(Category::getNestedCategories($id, $id_lang, false, $this->user_groups)); break; case 'PRD': @@ -609,6 +609,11 @@ class Blocktopmenu extends Module else $link = $this->context->link->getPageLink('index'); + /* Whenever a category is not active we shouldnt display it to customer */ + if ((bool)$cat->active === false) { + break; + } + $html .= 'page_name == 'category' && (int)Tools::getValue('id_category') == (int)$category['id_category']) ? ' class="sfHoverForce"' : '').'>'; $html .= ''.$category['name'].''; @@ -1161,7 +1166,7 @@ class Blocktopmenu extends Module $shops_to_get = Shop::getContextListShopID(); foreach ($shops_to_get as $shop_id) - $html .= $this->generateCategoriesOption($this->customGetNestedCategories($shop_id, null, (int)$this->context->language->id, true), $items); + $html .= $this->generateCategoriesOption($this->customGetNestedCategories($shop_id, null, (int)$this->context->language->id, false), $items); $html .= ''; // BEGIN Shops @@ -1206,7 +1211,7 @@ class Blocktopmenu extends Module } - public function customGetNestedCategories($shop_id, $root_category = null, $id_lang = false, $active = true, $groups = null, $use_shop_restriction = true, $sql_filter = '', $sql_sort = '', $sql_limit = '') + public function customGetNestedCategories($shop_id, $root_category = null, $id_lang = false, $active = false, $groups = null, $use_shop_restriction = true, $sql_filter = '', $sql_sort = '', $sql_limit = '') { if (isset($root_category) && !Validate::isInt($root_category)) die(Tools::displayError());