Merge pull request #1018 from vishal-singh-webkul/gli-1818

Fixed: Notices and display issue when there is no rooms and no hotel available.
This commit is contained in:
Rohit Jain
2024-07-02 14:20:01 +05:30
committed by GitHub
3 changed files with 9 additions and 5 deletions

View File

@@ -278,7 +278,7 @@ class AdminNormalProductsControllerCore extends AdminController
$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);
}

View File

@@ -245,9 +245,10 @@ class AdminProductsControllerCore extends AdminController
);
} 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 @@ class AdminProductsControllerCore extends AdminController
'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 @@ class AdminProductsControllerCore extends AdminController
$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);
}

View File

@@ -127,7 +127,10 @@ class WkRoomSearchBlock extends Module
// 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