diff --git a/controllers/admin/AdminNormalProductsController.php b/controllers/admin/AdminNormalProductsController.php index cf78be63c..4e61bf9aa 100644 --- a/controllers/admin/AdminNormalProductsController.php +++ b/controllers/admin/AdminNormalProductsController.php @@ -280,7 +280,7 @@ public function __construct() $idServiceCategory = Configuration::get('PS_SERVICE_CATEGORY'); $this->objLocationsCategory = new Category($idServiceCategory, $this->context->language->id); $nestedCategories = Category::getNestedCategories($idServiceCategory); - if ($nestedCategories) { + if (isset($nestedCategories[$idServiceCategory]['children']) && $nestedCategories[$idServiceCategory]['children']) { foreach ($nestedCategories[$idServiceCategory]['children'] as $childCategory) { $this->buildCategoryOptions($childCategory); } diff --git a/controllers/admin/AdminProductsController.php b/controllers/admin/AdminProductsController.php index 799be06a7..227aba78d 100644 --- a/controllers/admin/AdminProductsController.php +++ b/controllers/admin/AdminProductsController.php @@ -245,9 +245,10 @@ public function __construct() ); } else { $hotels = HotelBranchInformation::getProfileAccessedHotels($this->context->employee->id_profile, 1); + $hotelsArray = array(); foreach ($hotels as $hotel) { $addressInfo = HotelBranchInformation::getAddress($hotel['id_hotel']); - $this->hotelsArray[$hotel['id_hotel']] = $hotel['hotel_name'].', '.$addressInfo['city']; + $hotelsArray[$hotel['id_hotel']] = $hotel['hotel_name'].', '.$addressInfo['city']; } $this->fields_list['hotel_name'] = array( @@ -256,7 +257,7 @@ public function __construct() 'multiple' => true, 'operator' => 'or', 'filter_key' => 'hrt!id_hotel', - 'list' => $this->hotelsArray, + 'list' => $hotelsArray, 'optional' => true, 'class' => 'chosen', 'visible_default' => true, @@ -399,7 +400,7 @@ public function __construct() $idLocationsCategory = Configuration::get('PS_LOCATIONS_CATEGORY'); $this->objLocationsCategory = new Category($idLocationsCategory, $this->context->language->id); $nestedCategories = Category::getNestedCategories($idLocationsCategory); - if ($nestedCategories) { + if (isset($nestedCategories[$idLocationsCategory]['children']) && $nestedCategories[$idLocationsCategory]['children']) { foreach ($nestedCategories[$idLocationsCategory]['children'] as $childCategory) { $this->buildCategoryOptions($childCategory); } diff --git a/modules/wkroomsearchblock/wkroomsearchblock.php b/modules/wkroomsearchblock/wkroomsearchblock.php index 332a71028..25aa652c7 100644 --- a/modules/wkroomsearchblock/wkroomsearchblock.php +++ b/modules/wkroomsearchblock/wkroomsearchblock.php @@ -127,7 +127,10 @@ public function hookDisplayAfterHookTop($params) // In the xs sceen the booking button on the landing page public function hookDisplayAfterHeaderHotelDesc() { - return $this->display(__FILE__, 'landingPageXsBtn.tpl'); + $objHotelInfo = new HotelBranchInformation(); + if ($objHotelInfo->hotelBranchesInfo(0, 1)) { + return $this->display(__FILE__, 'landingPageXsBtn.tpl'); + } } // search panel block on the category page on left block