From 9cfb77554a08f220fd4204b571407d812f197bd0 Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Wed, 3 Apr 2024 15:13:35 +0530 Subject: [PATCH 1/7] Fixed: Notice in Admin products when QloApps is installed without the demo data --- controllers/admin/AdminProductsController.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/controllers/admin/AdminProductsController.php b/controllers/admin/AdminProductsController.php index 3763fb057..0a5bbcf7e 100644 --- a/controllers/admin/AdminProductsController.php +++ b/controllers/admin/AdminProductsController.php @@ -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', 'remove_onchange' => true, @@ -401,7 +402,10 @@ 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']) + && is_array($nestedCategories[$idLocationsCategory]['children']) + && count($nestedCategories[$idLocationsCategory]['children']) + ) { foreach ($nestedCategories[$idLocationsCategory]['children'] as $childCategory) { $this->buildCategoryOptions($childCategory); } @@ -617,7 +621,7 @@ class AdminProductsControllerCore extends AdminController // convert price with the currency from context $this->_list[$i]['price'] = Tools::convertPrice($this->_list[$i]['price'], $this->context->currency, true, $this->context); $this->_list[$i]['price_tmp'] = Product::getPriceStatic($this->_list[$i]['id_product'], true, null, - (int)Configuration::get('PS_PRICE_DISPLAY_PRECISION'), null, false, true, 1, true, null, null, null, $nothing, true, true, + (int)Configuration::get('PS_PRICE_DISPLAY_PRECISION'), null, false, true, 1, true, null, null, null, null, true, true, $context); } } From 0be773cc480d4a33a759b86b5797a9271505e59a Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Fri, 19 Apr 2024 10:12:18 +0530 Subject: [PATCH 2/7] Updated: Select fields created with fields_options will now show empty dropdown in case no option is availabe --- admin/themes/default/template/helpers/options/options.tpl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/admin/themes/default/template/helpers/options/options.tpl b/admin/themes/default/template/helpers/options/options.tpl index 24a6094cd..527850f73 100644 --- a/admin/themes/default/template/helpers/options/options.tpl +++ b/admin/themes/default/template/helpers/options/options.tpl @@ -138,6 +138,9 @@ {elseif isset($input.empty_message)} {$input.empty_message} + {else} + {/if} {elseif $field['type'] == 'bool'} From f54a67258e38199ab3bbef73c929443c33bdfeef Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Thu, 9 May 2024 18:31:02 +0530 Subject: [PATCH 3/7] Fixed: The make booking button on the mobile screen when there is no hotel available --- modules/wkroomsearchblock/wkroomsearchblock.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/wkroomsearchblock/wkroomsearchblock.php b/modules/wkroomsearchblock/wkroomsearchblock.php index dc696e4af..f1b732122 100644 --- a/modules/wkroomsearchblock/wkroomsearchblock.php +++ b/modules/wkroomsearchblock/wkroomsearchblock.php @@ -116,7 +116,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 From 0e46e07faf9c78e2090025f2ca9099b69c6fd2a5 Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Tue, 28 May 2024 16:04:35 +0530 Subject: [PATCH 4/7] Revert changes for the getPriceStatic() call in admin products controller --- controllers/admin/AdminProductsController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/admin/AdminProductsController.php b/controllers/admin/AdminProductsController.php index b7778dc0e..c5591c1e0 100644 --- a/controllers/admin/AdminProductsController.php +++ b/controllers/admin/AdminProductsController.php @@ -618,7 +618,7 @@ class AdminProductsControllerCore extends AdminController // convert price with the currency from context $this->_list[$i]['price'] = Tools::convertPrice($this->_list[$i]['price'], $this->context->currency, true, $this->context); $this->_list[$i]['price_tmp'] = Product::getPriceStatic($this->_list[$i]['id_product'], true, null, - (int)Configuration::get('PS_PRICE_DISPLAY_PRECISION'), null, false, true, 1, true, null, null, null, null, true, true, + (int)Configuration::get('PS_PRICE_DISPLAY_PRECISION'), null, false, true, 1, true, null, null, null, $nothing, true, true, $context); } } From 79d6dbaa6a638f5ea40b9d013dca181df07e7d2b Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Fri, 21 Jun 2024 11:08:32 +0530 Subject: [PATCH 5/7] Fixed: Admin normal products page errors when no hotel is created --- controllers/admin/AdminNormalProductsController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 @@ 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); } From e98e60fd80524869428b72ee29b2f372615e842c Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Fri, 21 Jun 2024 11:18:50 +0530 Subject: [PATCH 6/7] Updated the changes made in the previous commits --- controllers/admin/AdminProductsController.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/controllers/admin/AdminProductsController.php b/controllers/admin/AdminProductsController.php index c5591c1e0..54a9a306a 100644 --- a/controllers/admin/AdminProductsController.php +++ b/controllers/admin/AdminProductsController.php @@ -400,10 +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 (isset($nestedCategories[$idLocationsCategory]['children']) - && is_array($nestedCategories[$idLocationsCategory]['children']) - && count($nestedCategories[$idLocationsCategory]['children']) - ) { + if (isset($nestedCategories[$idLocationsCategory]['children']) && $nestedCategories[$idLocationsCategory]['children']) { foreach ($nestedCategories[$idLocationsCategory]['children'] as $childCategory) { $this->buildCategoryOptions($childCategory); } From d857b8cc255bfadce17e5f823559ba85ad347084 Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Thu, 27 Jun 2024 19:50:07 +0530 Subject: [PATCH 7/7] revert: the changes made to options.tpl --- admin/themes/default/template/helpers/options/options.tpl | 3 --- 1 file changed, 3 deletions(-) diff --git a/admin/themes/default/template/helpers/options/options.tpl b/admin/themes/default/template/helpers/options/options.tpl index 527850f73..24a6094cd 100644 --- a/admin/themes/default/template/helpers/options/options.tpl +++ b/admin/themes/default/template/helpers/options/options.tpl @@ -138,9 +138,6 @@ {elseif isset($input.empty_message)} {$input.empty_message} - {else} - {/if} {elseif $field['type'] == 'bool'}