Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed: Notices and display issue when there is no rooms and no hotel available. #1018

Merged
merged 10 commits into from
Jul 2, 2024
Merged
2 changes: 1 addition & 1 deletion controllers/admin/AdminNormalProductsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
7 changes: 4 additions & 3 deletions controllers/admin/AdminProductsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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,
Expand Down Expand Up @@ -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);
}
Expand Down
5 changes: 4 additions & 1 deletion modules/wkroomsearchblock/wkroomsearchblock.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down