From 6ea52670c450e3cdcae21c24e99270191bf58e94 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Fri, 31 Mar 2023 12:27:18 +0530 Subject: [PATCH 01/37] Allow checkout process classes to be overridden --- classes/checkoutProcess/AbstractCheckoutStep.php | 2 +- classes/checkoutProcess/CheckoutCartSummaryStep.php | 2 +- classes/checkoutProcess/CheckoutCustomerDetailsStep.php | 2 +- classes/checkoutProcess/CheckoutPaymentStep.php | 2 +- classes/checkoutProcess/CheckoutProcess.php | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/classes/checkoutProcess/AbstractCheckoutStep.php b/classes/checkoutProcess/AbstractCheckoutStep.php index 185e131dc..9904e5d36 100644 --- a/classes/checkoutProcess/AbstractCheckoutStep.php +++ b/classes/checkoutProcess/AbstractCheckoutStep.php @@ -24,7 +24,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -abstract class AbstractCheckoutStep implements CheckoutStepInterface +abstract class AbstractCheckoutStepCore implements CheckoutStepInterface { public $step_is_reachable = 0; public $step_is_complete = 0; diff --git a/classes/checkoutProcess/CheckoutCartSummaryStep.php b/classes/checkoutProcess/CheckoutCartSummaryStep.php index 6b9b9b389..634922ff2 100644 --- a/classes/checkoutProcess/CheckoutCartSummaryStep.php +++ b/classes/checkoutProcess/CheckoutCartSummaryStep.php @@ -18,7 +18,7 @@ * @license https://store.webkul.com/license.html */ -class CheckoutCartSummaryStep extends AbstractCheckoutStep +class CheckoutCartSummaryStepCore extends AbstractCheckoutStepCore { public function __construct() { diff --git a/classes/checkoutProcess/CheckoutCustomerDetailsStep.php b/classes/checkoutProcess/CheckoutCustomerDetailsStep.php index 7ec1fef59..b8933ae06 100644 --- a/classes/checkoutProcess/CheckoutCustomerDetailsStep.php +++ b/classes/checkoutProcess/CheckoutCustomerDetailsStep.php @@ -18,7 +18,7 @@ * @license https://store.webkul.com/license.html */ -class CheckoutCustomerDetailsStep extends AbstractCheckoutStep +class CheckoutCustomerDetailsStepCore extends AbstractCheckoutStepCore { public function __construct() { diff --git a/classes/checkoutProcess/CheckoutPaymentStep.php b/classes/checkoutProcess/CheckoutPaymentStep.php index 504d762f6..b55f3e8fc 100644 --- a/classes/checkoutProcess/CheckoutPaymentStep.php +++ b/classes/checkoutProcess/CheckoutPaymentStep.php @@ -18,7 +18,7 @@ * @license https://store.webkul.com/license.html */ -class CheckoutPaymentStep extends AbstractCheckoutStep +class CheckoutPaymentStepCore extends AbstractCheckoutStepCore { public function __construct() { parent::__construct(); diff --git a/classes/checkoutProcess/CheckoutProcess.php b/classes/checkoutProcess/CheckoutProcess.php index 0944d3d44..f1d6d30e3 100644 --- a/classes/checkoutProcess/CheckoutProcess.php +++ b/classes/checkoutProcess/CheckoutProcess.php @@ -18,7 +18,7 @@ * @license https://store.webkul.com/license.html */ -class CheckoutProcess +class CheckoutProcessCore { public $steps = array(); From 9770cd6ae1385101b21016320d5e2856f99529ca Mon Sep 17 00:00:00 2001 From: "lakshya.chauhan193" Date: Fri, 31 Mar 2023 14:36:02 +0530 Subject: [PATCH 02/37] updated changes for front-office --- .../views/js/admin/hotel_rooms_booking.js | 2 +- modules/wkroomsearchblock/views/css/wk-global-search.css | 3 ++- modules/wkroomsearchblock/views/js/wk-room-search-block.js | 2 +- modules/wkroomsearchblock/views/templates/hook/searchForm.tpl | 4 ++-- themes/hotel-reservation-theme/js/occupancy.js | 2 +- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/modules/hotelreservationsystem/views/js/admin/hotel_rooms_booking.js b/modules/hotelreservationsystem/views/js/admin/hotel_rooms_booking.js index de5b4a126..5e42fef23 100644 --- a/modules/hotelreservationsystem/views/js/admin/hotel_rooms_booking.js +++ b/modules/hotelreservationsystem/views/js/admin/hotel_rooms_booking.js @@ -713,7 +713,7 @@ $(document).ready(function() { occupancy_block += ''; occupancy_block += ''; occupancy_block += '
'; - occupancy_block += ''; + occupancy_block += ''; occupancy_block += '(' + below_txt + ' ' + max_child_age + ' ' + years_txt + ')'; occupancy_block += '
'; occupancy_block += ''; diff --git a/modules/wkroomsearchblock/views/css/wk-global-search.css b/modules/wkroomsearchblock/views/css/wk-global-search.css index 155e843b7..8234891ea 100644 --- a/modules/wkroomsearchblock/views/css/wk-global-search.css +++ b/modules/wkroomsearchblock/views/css/wk-global-search.css @@ -172,7 +172,8 @@ .header-rmsearch-wrapper .label-desc-txt { font-size: 12px; - color: #777777;} + color: #777777; + margin: 0;} .header-rmsearch-wrapper .btn { font-weight: 600;} .header-rmsearch-wrapper .btn-primary { diff --git a/modules/wkroomsearchblock/views/js/wk-room-search-block.js b/modules/wkroomsearchblock/views/js/wk-room-search-block.js index b60e3a77b..31d43b2ff 100644 --- a/modules/wkroomsearchblock/views/js/wk-room-search-block.js +++ b/modules/wkroomsearchblock/views/js/wk-room-search-block.js @@ -365,7 +365,7 @@ $(document).ready(function() { occupancy_block += ''; occupancy_block += ''; occupancy_block += '
'; - occupancy_block += ''; + occupancy_block += ''; occupancy_block += '
'; occupancy_block += ''; occupancy_block += '
'; diff --git a/modules/wkroomsearchblock/views/templates/hook/searchForm.tpl b/modules/wkroomsearchblock/views/templates/hook/searchForm.tpl index 6f5dae6c9..7ddaa1556 100644 --- a/modules/wkroomsearchblock/views/templates/hook/searchForm.tpl +++ b/modules/wkroomsearchblock/views/templates/hook/searchForm.tpl @@ -92,7 +92,7 @@
- +
@@ -157,7 +157,7 @@
- +
diff --git a/themes/hotel-reservation-theme/js/occupancy.js b/themes/hotel-reservation-theme/js/occupancy.js index f3679b234..7939edf27 100644 --- a/themes/hotel-reservation-theme/js/occupancy.js +++ b/themes/hotel-reservation-theme/js/occupancy.js @@ -218,7 +218,7 @@ $(document).ready(function(){ occupancy_block += '
'; occupancy_block += '
'; occupancy_block += '
'; - occupancy_block += ''; + occupancy_block += ''; occupancy_block += '
'; occupancy_block += ''; occupancy_block += '
'; From 2fbae2042bb927353706a15800ca778c32b0ab12 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Fri, 31 Mar 2023 16:41:54 +0530 Subject: [PATCH 03/37] Prevent required categories deletion --- modules/qlocleaner/qlocleaner.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/modules/qlocleaner/qlocleaner.php b/modules/qlocleaner/qlocleaner.php index 8f0e96393..eada90ec5 100644 --- a/modules/qlocleaner/qlocleaner.php +++ b/modules/qlocleaner/qlocleaner.php @@ -204,11 +204,19 @@ class QloCleaner extends Module switch ($case) { case 'catalog': - $id_home = Configuration::getMultiShopValues('PS_HOME_CATEGORY'); $id_root = Configuration::getMultiShopValues('PS_ROOT_CATEGORY'); - $db->execute('DELETE FROM `'._DB_PREFIX_.'category` WHERE id_category NOT IN ('.implode(',', array_map('intval', $id_home)).', '.implode(',', array_map('intval', $id_root)).')'); - $db->execute('DELETE FROM `'._DB_PREFIX_.'category_lang` WHERE id_category NOT IN ('.implode(',', array_map('intval', $id_home)).', '.implode(',', array_map('intval', $id_root)).')'); - $db->execute('DELETE FROM `'._DB_PREFIX_.'category_shop` WHERE id_category NOT IN ('.implode(',', array_map('intval', $id_home)).', '.implode(',', array_map('intval', $id_root)).')'); + $id_home = Configuration::getMultiShopValues('PS_HOME_CATEGORY'); + $id_locations = Configuration::getMultiShopValues('PS_LOCATIONS_CATEGORY'); + $id_services = Configuration::getMultiShopValues('PS_SERVICE_CATEGORY'); + + $not_in = implode(',', array_map('intval', $id_root)).','. + implode(',', array_map('intval', $id_home)).','. + implode(',', array_map('intval', $id_locations)).','. + implode(',', array_map('intval', $id_services)); + + $db->execute('DELETE FROM `'._DB_PREFIX_.'category` WHERE id_category NOT IN ('.$not_in.')'); + $db->execute('DELETE FROM `'._DB_PREFIX_.'category_lang` WHERE id_category NOT IN ('.$not_in.')'); + $db->execute('DELETE FROM `'._DB_PREFIX_.'category_shop` WHERE id_category NOT IN ('.$not_in.')'); foreach (scandir(_PS_CAT_IMG_DIR_) as $dir) { if (preg_match('/^[0-9]+(\-(.*))?\.jpg$/', $dir)) { unlink(_PS_CAT_IMG_DIR_.$dir); From a9a205387efedb819ef96b9f768b255949b0a709 Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Mon, 3 Apr 2023 13:05:13 +0530 Subject: [PATCH 04/37] fix undefined cover_image while generating invoice --- classes/pdf/HTMLTemplateInvoice.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/classes/pdf/HTMLTemplateInvoice.php b/classes/pdf/HTMLTemplateInvoice.php index bc157bf1f..300367e9f 100644 --- a/classes/pdf/HTMLTemplateInvoice.php +++ b/classes/pdf/HTMLTemplateInvoice.php @@ -358,7 +358,6 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate $rm_dtl = $obj_rm_type->getRoomTypeInfoByIdProduct($type_value['product_id']); $cart_htl_data[$type_key]['id_product'] = $type_value['product_id']; - $cart_htl_data[$type_key]['cover_img'] = $cover_img; $cart_htl_data[$type_key]['hotel_name'] = $rm_dtl['hotel_name']; $objBookingDemand = new HotelBookingDemands(); foreach ($order_bk_data as $data_k => $data_v) { @@ -579,13 +578,14 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate $totalDemandsPriceTE += $cart_htl_data[$type_key]['date_diff'][$date_join]['extra_demands_price_te']; $totalDemandsPriceTI += $cart_htl_data[$type_key]['date_diff'][$date_join]['extra_demands_price_ti']; } - if ($extraDemands = array_shift($objBookingDemand->getRoomTypeBookingExtraDemands( + if ($extraDemands = $objBookingDemand->getRoomTypeBookingExtraDemands( $order_obj->id, $type_value['product_id'], $data_v['id_room'], $data_v['date_from'], $data_v['date_to'] - ))) { + )) { + $extraDemands = array_shift($extraDemands); $extraDemands['product_id'] = $type_value['product_id']; $extraDemands['room_type_name'] = $type_value['product_name']; $extraDemands['date_from'] = $data_v['date_from']; @@ -593,7 +593,7 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate $room_extra_demands[] = $extraDemands; } - if ($additionalServices = array_shift($objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts( + if ($additionalServices = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts( $order_obj->id, 0, 0, @@ -601,8 +601,8 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate $data_v['date_from'], $data_v['date_to'], $data_v['id_room'] - ))) { - + )) { + $additionalServices = array_shift($additionalServices); $additionalServices['product_id'] = $type_value['product_id']; $additionalServices['room_type_name'] = $type_value['product_name']; $additionalServices['date_from'] = $data_v['date_from']; @@ -610,7 +610,6 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate $room_additinal_services[] = $additionalServices; } - // Set tax_code if ($taxes = OrderDetail::getTaxListStatic($data_v['id_order_detail'])) { $tax_temp = array(); From 26d9a3de821ef4c1b08128ae1c4c26e776bb5de7 Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Mon, 3 Apr 2023 13:13:33 +0530 Subject: [PATCH 05/37] updated service and facilities admin panel text changes --- .../template/controllers/normal_products/prices.tpl | 4 ++-- .../controllers/products/additionalfacilities.tpl | 4 ++-- .../template/controllers/products/serviceproduct.tpl | 6 +++--- controllers/admin/AdminOrdersController.php | 8 +++++--- controllers/admin/AdminProductsController.php | 1 + .../classes/RoomTypeServiceProduct.php | 2 +- 6 files changed, 14 insertions(+), 11 deletions(-) diff --git a/admin/themes/default/template/controllers/normal_products/prices.tpl b/admin/themes/default/template/controllers/normal_products/prices.tpl index be8a69b43..9b91f7206 100644 --- a/admin/themes/default/template/controllers/normal_products/prices.tpl +++ b/admin/themes/default/template/controllers/normal_products/prices.tpl @@ -203,9 +203,9 @@ $(document).ready(function () { {if isset($pack) && $pack->isPack($product->id)}

{l s='The sum of prices of the products in the pack is %s%s%s' sprintf=[$currency->prefix,{toolsConvertPrice price=$pack->noPackPrice($product->id)|string_format:$priceDisplayPrecisionFormat},$currency->suffix]}

{/if}
-
- {displayPrice price={$demand['price']|escape:'html':'UTF-8'} currency=$module->id_currency} + {displayPrice price={$demand['price']|escape:'html':'UTF-8'} currency=$idDefaultcurrency}
diff --git a/admin/themes/default/template/controllers/products/serviceproduct.tpl b/admin/themes/default/template/controllers/products/serviceproduct.tpl index 5baab2136..be79c8694 100644 --- a/admin/themes/default/template/controllers/products/serviceproduct.tpl +++ b/admin/themes/default/template/controllers/products/serviceproduct.tpl @@ -15,7 +15,7 @@ {l s='name'} - {l s='Category'} + {l s='Auto add to cart'} {l s='Position'} @@ -45,14 +45,14 @@
- {if isset($service_product.custom_price) && $service_product.custom_price}{displayPrice price=$service_product.custom_price currency=$id_currency}{else}{displayPrice price=$service_product.default_price currency=$id_currency}{/if} + {if isset($service_product.custom_price) && $service_product.custom_price}{displayPrice price=$service_product.custom_price currency=$currency->id}{else}{displayPrice price=$service_product.default_price currency=$currency->id}{/if} -
{l s='Default price: %s' sprintf={displayPrice price=$service_product.default_price currency=$id_currency}} +
{l s='Default price: %s' sprintf={displayPrice price=$service_product.default_price currency=$currency->id}} {if isset($service_product.tax_rules_group_name) && $service_product.tax_rules_group_name}{$service_product.tax_rules_group_name}{else}{$service_product.default_tax_rules_group_name}{/if} diff --git a/controllers/admin/AdminOrdersController.php b/controllers/admin/AdminOrdersController.php index 039260ad1..7599f226c 100644 --- a/controllers/admin/AdminOrdersController.php +++ b/controllers/admin/AdminOrdersController.php @@ -4750,9 +4750,11 @@ class AdminOrdersControllerCore extends AdminController // get room type additional demands $objRoomTypeServiceProduct = new RoomTypeServiceProduct(); if ($roomTypeServiceProducts = $objRoomTypeServiceProduct->getServiceProductsData($idProduct, 1, 0, false, 2, null)) { - foreach ($roomTypeServiceProducts as $key => $product) { - if (in_array($product['id_product'], array_column($additionalServices['additional_services'], 'id_product'))) { - unset($roomTypeServiceProducts[$key]); + if ($additionalServices) { + foreach ($roomTypeServiceProducts as $key => $product) { + if (in_array($product['id_product'], array_column($additionalServices['additional_services'], 'id_product'))) { + unset($roomTypeServiceProducts[$key]); + } } } $smartyVars['roomTypeServiceProducts'] = $roomTypeServiceProducts; diff --git a/controllers/admin/AdminProductsController.php b/controllers/admin/AdminProductsController.php index 88df3cd66..514c0fc28 100644 --- a/controllers/admin/AdminProductsController.php +++ b/controllers/admin/AdminProductsController.php @@ -3298,6 +3298,7 @@ class AdminProductsControllerCore extends AdminController 'selectedDemands' => $selectedDemands, 'allDemands' => $allDemands, 'defaultcurrencySign' => $objCurrency->sign, + 'idDefaultcurrency' => $objCurrency->id, )); } else { $this->displayWarning($this->l('You must save this room type before managing additional facilities.')); diff --git a/modules/hotelreservationsystem/classes/RoomTypeServiceProduct.php b/modules/hotelreservationsystem/classes/RoomTypeServiceProduct.php index 2b4b84113..4cb2df0e2 100644 --- a/modules/hotelreservationsystem/classes/RoomTypeServiceProduct.php +++ b/modules/hotelreservationsystem/classes/RoomTypeServiceProduct.php @@ -99,7 +99,7 @@ class RoomTypeServiceProduct extends ObjectModel public function getProductsForRoomType($idProductRoomType) { - $sql .= 'SELECT `id_room_type_service_product`, `id_product`, `position` FROM `'._DB_PREFIX_.'htl_room_type_service_product` + $sql = 'SELECT `id_room_type_service_product`, `id_product`, `position` FROM `'._DB_PREFIX_.'htl_room_type_service_product` WHERE `element_type` = '.self::WK_ELEMENT_TYPE_ROOM_TYPE.' AND `id_element` = '.(int)$idProductRoomType.' ORDER BY `position` ASC'; From f3f7c86cd21760e8891ad4198696041394652ed2 Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Mon, 3 Apr 2023 18:37:29 +0530 Subject: [PATCH 06/37] fix module update error when uploading zip without db changes --- controllers/admin/AdminModulesController.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/controllers/admin/AdminModulesController.php b/controllers/admin/AdminModulesController.php index 7e0b23ffb..0eae6b275 100644 --- a/controllers/admin/AdminModulesController.php +++ b/controllers/admin/AdminModulesController.php @@ -1836,7 +1836,9 @@ class AdminModulesControllerCore extends AdminController $this->errors[] = $this->l('Module not found!'); } } else { - $this->errors[] = $this->l('There was some error while updating the module'); + $response['success'] = true; + $response['msg'] = $this->l('Module files updated successfully'); + $response['data']['redirect'] = $this->context->link->getAdminLink('AdminModules').'&conf=29&anchor='.$module->name; } } else { $this->errors[] = $this->l('Module not installed, install module before updating.'); From a4adc57c13b761d1d0bdd2d53337a921a1e1237d Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Tue, 4 Apr 2023 10:36:13 +0530 Subject: [PATCH 07/37] fix guest tracking page error --- controllers/front/GuestTrackingController.php | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/controllers/front/GuestTrackingController.php b/controllers/front/GuestTrackingController.php index dca2c4266..e2210bfeb 100644 --- a/controllers/front/GuestTrackingController.php +++ b/controllers/front/GuestTrackingController.php @@ -285,6 +285,13 @@ class GuestTrackingControllerCore extends FrontController if ($data_v['is_back_order']) { $anyBackOrder = 1; } + if ($data_v['is_refunded']) { + $cartHotelData[$type_key]['date_diff'][$date_join]['count_refunded'] += 1; + } + if ($data_v['is_cancelled']) { + $cartHotelData[$type_key]['date_diff'][$date_join]['count_cancelled'] += 1; + $cartHotelData[$type_key]['date_diff'][$date_join]['count_refunded'] -= 1; + } } else { $num_days = $objBookingDetail->getNumberOfDays($data_v['date_from'], $data_v['date_to']); $cartHotelData[$type_key]['date_diff'][$date_join]['num_rm'] = 1; @@ -304,8 +311,19 @@ class GuestTrackingControllerCore extends FrontController if ($data_v['is_back_order']) { $anyBackOrder = 1; } + $cartHotelData[$type_key]['date_diff'][$date_join]['count_cancelled'] = 0; + $cartHotelData[$type_key]['date_diff'][$date_join]['count_refunded'] = 0; + if ($data_v['is_refunded']) { + $cartHotelData[$type_key]['date_diff'][$date_join]['count_refunded'] += 1; + } + if ($data_v['is_cancelled']) { + $cartHotelData[$type_key]['date_diff'][$date_join]['count_cancelled'] += 1; + $cartHotelData[$type_key]['date_diff'][$date_join]['count_refunded'] -= 1; + } } + $cartHotelData[$type_key]['date_diff'][$date_join]['is_refunded'] = $data_v['is_refunded']; + $cartHotelData[$type_key]['date_diff'][$date_join]['ids_htl_booking_detail'][] = $data_v['id']; $cartHotelData[$type_key]['date_diff'][$date_join]['extra_demands'] = $objBookingDemand->getRoomTypeBookingExtraDemands( @@ -390,6 +408,39 @@ class GuestTrackingControllerCore extends FrontController 1, 0 ); + // get auto added price to be displayed with room price + if (empty($cartHotelData[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_ti'])) { + $cartHotelData[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_ti'] = 0; + } + $cartHotelData[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_ti'] += $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts( + $idOrder, + 0, + 0, + $type_value['product_id'], + $data_v['date_from'], + $data_v['date_to'], + $data_v['id_room'], + 1, + 1, + 1, + Product::PRICE_ADDITION_TYPE_WITH_ROOM + ); + if (empty($cartHotelData[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_te'])) { + $cartHotelData[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_te'] = 0; + } + $cartHotelData[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_te'] += $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts( + $idOrder, + 0, + 0, + $type_value['product_id'], + $data_v['date_from'], + $data_v['date_to'], + $data_v['id_room'], + 1, + 0, + 1, + Product::PRICE_ADDITION_TYPE_WITH_ROOM + ); } // get auto added price to be displayed with room price if (empty($cartHotelData[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_ti'])) { From 7e71c55e867d53bac9c63465654d12c14c5fd17d Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Tue, 4 Apr 2023 11:03:45 +0530 Subject: [PATCH 08/37] fix extra servies pop up on order follow page --- controllers/front/GuestTrackingController.php | 23 ++++++++++++++++--- .../hotel-reservation-theme/order-detail.tpl | 2 +- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/controllers/front/GuestTrackingController.php b/controllers/front/GuestTrackingController.php index e2210bfeb..806e2dfa5 100644 --- a/controllers/front/GuestTrackingController.php +++ b/controllers/front/GuestTrackingController.php @@ -115,6 +115,7 @@ class GuestTrackingControllerCore extends FrontController $method = Tools::getValue('method'); if ($method == 'getRoomTypeBookingDemands') { + $response = array('reload' => false); $extraDemandsTpl = ''; if (($idProduct = Tools::getValue('id_product')) && ($idOrder = Tools::getValue('id_order')) @@ -122,7 +123,6 @@ class GuestTrackingControllerCore extends FrontController && ($dateTo = Tools::getValue('date_to')) ) { $objBookingDemand = new HotelBookingDemands(); - $order = new Order($idOrder); $customer = new Customer((int)$order->id_customer); $useTax = 0; if (Group::getPriceDisplayMethod($customer->id_default_group) == PS_TAX_INC) { @@ -144,10 +144,27 @@ class GuestTrackingControllerCore extends FrontController 'extraDemands' => $extraDemands, ) ); - $extraDemandsTpl .= $this->context->smarty->fetch(_PS_THEME_DIR_.'_partials/order_booking_demands.tpl'); } + $objRoomTypeServiceProductOrderDetail = new RoomTypeServiceProductOrderDetail(); + if ($additionalServices = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts( + $idOrder, + 0, + 0, + $idProduct, + $dateFrom, + $dateTo, + 0, + 0, + $useTax + )) { + $this->context->smarty->assign(array( + 'useTax' => $useTax, + 'additionalServices' => $additionalServices, + )); + } + $response['extra_demands'] = $this->context->smarty->fetch(_PS_THEME_DIR_.'_partials/order_booking_demands.tpl'); } - die($extraDemandsTpl); + $this->ajaxDie(json_encode($response)); } /* Handle brute force attacks */ diff --git a/themes/hotel-reservation-theme/order-detail.tpl b/themes/hotel-reservation-theme/order-detail.tpl index 532599299..96af48089 100644 --- a/themes/hotel-reservation-theme/order-detail.tpl +++ b/themes/hotel-reservation-theme/order-detail.tpl @@ -414,7 +414,7 @@ {if (isset($rm_v['extra_demands']) && $rm_v['extra_demands']) || isset($rm_v['additional_services']) && $rm_v['additional_services']} - + {/if} {if $group_use_tax} {displayWtPriceWithCurrency price=($rm_v['extra_demands_price_ti'] + $rm_v['additional_services_price_ti']) currency=$currency} From b6d5b1e399fd2391e0538e9cfeb1947be23532ff Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Tue, 4 Apr 2023 11:16:19 +0530 Subject: [PATCH 09/37] improved occupancy dropdorm on search result page --- themes/hotel-reservation-theme/css/category.css | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/themes/hotel-reservation-theme/css/category.css b/themes/hotel-reservation-theme/css/category.css index d9a7fba5e..2e47c512e 100644 --- a/themes/hotel-reservation-theme/css/category.css +++ b/themes/hotel-reservation-theme/css/category.css @@ -251,10 +251,10 @@ p.capa_txt { .booking_guest_occupancy_conatiner { display: flex; } -.booking_guest_occupancy_conatiner .booking_occupancy_wrapper { - left: unset; -} @media (min-width: 992px) { + .booking_guest_occupancy_conatiner .booking_occupancy_wrapper { + left: unset; + } .room_features_cont > div { display: flex; flex-wrap: wrap; From 4b90be4b919a8d95ea32e86287b22b0e964bd70c Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Tue, 4 Apr 2023 12:11:16 +0530 Subject: [PATCH 10/37] fix qlocleaner integrity contraint issue --- modules/qlocleaner/qlocleaner.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/qlocleaner/qlocleaner.php b/modules/qlocleaner/qlocleaner.php index 8f0e96393..ead6bc5ec 100644 --- a/modules/qlocleaner/qlocleaner.php +++ b/modules/qlocleaner/qlocleaner.php @@ -646,18 +646,17 @@ class QloCleaner extends Module array('htl_features_block_data_lang', 'id_features_block', 'htl_features_block_data', 'id_features_block'), array('cart_rule', 'id_customer', 'customer', 'id_customer'), array('htl_testimonials_block_data_lang', 'id_testimonial_block', 'htl_testimonials_block_data', 'id_testimonial_block'), - array('htl_room_type_global_demand', 'id_tax_rules_group', 'tax_rules_group', 'id_tax_rules_group'), array('htl_room_type_global_demand_advance_option', 'id_global_demand', 'htl_room_type_global_demand', 'id_global_demand'), + array('htl_room_type_global_demand_advance_option_lang', 'id_lang', 'lang', 'id_lang'), array('htl_room_type_global_demand_advance_option_lang', 'id_option', 'htl_room_type_global_demand_advance_option', 'id_option'), array('htl_room_type_global_demand_lang', 'id_global_demand', 'htl_room_type_global_demand', 'id_global_demand'), array('htl_branch_info_lang', 'id_lang', 'lang', 'id_lang'), array('htl_branch_info_lang', 'id', 'htl_branch_info', 'id'), array('htl_features_lang', 'id_lang', 'lang', 'id_lang'), array('htl_features_lang', 'id', 'htl_features', 'id'), + array('htl_room_type_demand', 'id_global_demand', 'htl_room_type_global_demand', 'id_global_demand'), array('htl_room_type_demand', 'id_product', 'product', 'id_product'), array('htl_room_type_demand_price', 'id_product', 'product', 'id_product'), - array('htl_room_type_global_demand_advance_option_lang', 'id_lang', 'lang', 'id_lang'), - array('htl_room_type_global_demand_advance_option_lang', 'id_option', 'htl_room_type_global_demand_advance_option', 'id_option'), array('htl_room_type_feature_pricing_group', 'id_group', 'group', 'id_group'), array('htl_booking_demands_tax', 'id_tax', 'tax', 'id_tax'), array('htl_booking_detail', 'id_product', 'product', 'id_product'), From cfe3bab2bcff076f1cda8bff774ba6b81a67ef06 Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Tue, 4 Apr 2023 13:15:50 +0530 Subject: [PATCH 11/37] fix backoffice header toolbar buttons not visible on some pages --- classes/controller/AdminController.php | 19 +++++++------------ .../admin/AdminEmployeesController.php | 4 ++-- controllers/admin/AdminThemesController.php | 4 ++-- 3 files changed, 11 insertions(+), 16 deletions(-) diff --git a/classes/controller/AdminController.php b/classes/controller/AdminController.php index cd64e7e99..ea3a469f7 100644 --- a/classes/controller/AdminController.php +++ b/classes/controller/AdminController.php @@ -1628,14 +1628,6 @@ class AdminControllerCore extends Controller $this->context->smarty->assign('help_link', 'http://help.prestashop.com/'.Language::getIsoById($this->context->employee->id_lang).'/doc/' .Tools::getValue('controller').'?version='._PS_VERSION_.'&country='.Language::getIsoById($this->context->employee->id_lang)); - - $this->context->smarty->assign(array( - 'show_page_header_toolbar' => $this->show_page_header_toolbar, - 'page_header_toolbar_title' => $this->page_header_toolbar_title, - 'title' => $this->page_header_toolbar_title, - 'toolbar_btn' => $this->page_header_toolbar_btn, - 'page_header_toolbar_btn' => $this->page_header_toolbar_btn, - )); } /** @@ -2138,11 +2130,9 @@ class AdminControllerCore extends Controller $this->initPageHeaderToolbar(); if ($this->display == 'edit' || $this->display == 'add') { - if (!$this->loadObject(true)) { - return; + if ($this->loadObject(true)) { + $this->content .= $this->renderForm(); } - - $this->content .= $this->renderForm(); } elseif ($this->display == 'view') { // Some controllers use the view action without an object if ($this->className) { @@ -2168,6 +2158,11 @@ class AdminControllerCore extends Controller 'content' => $this->content, 'lite_display' => $this->lite_display, 'url_post' => self::$currentIndex.'&token='.$this->token, + 'show_page_header_toolbar' => $this->show_page_header_toolbar, + 'page_header_toolbar_title' => $this->page_header_toolbar_title, + 'title' => $this->page_header_toolbar_title, + 'toolbar_btn' => $this->page_header_toolbar_btn, + 'page_header_toolbar_btn' => $this->page_header_toolbar_btn, )); } diff --git a/controllers/admin/AdminEmployeesController.php b/controllers/admin/AdminEmployeesController.php index 64308b5a7..ab1a12d45 100644 --- a/controllers/admin/AdminEmployeesController.php +++ b/controllers/admin/AdminEmployeesController.php @@ -175,6 +175,8 @@ class AdminEmployeesControllerCore extends AdminController public function initPageHeaderToolbar() { + parent::initPageHeaderToolbar(); + if (empty($this->display)) { $this->page_header_toolbar_btn['new_employee'] = array( 'href' => self::$currentIndex.'&addemployee&token='.$this->token, @@ -193,8 +195,6 @@ class AdminEmployeesControllerCore extends AdminController $this->toolbar_title); } } - - parent::initPageHeaderToolbar(); } public function renderList() diff --git a/controllers/admin/AdminThemesController.php b/controllers/admin/AdminThemesController.php index 7dbd73476..4a3a306c7 100644 --- a/controllers/admin/AdminThemesController.php +++ b/controllers/admin/AdminThemesController.php @@ -716,6 +716,8 @@ class AdminThemesControllerCore extends AdminController public function initPageHeaderToolbar() { + parent::initPageHeaderToolbar(); + if (empty($this->display)) { $this->page_header_toolbar_btn['import_theme'] = array( 'href' => self::$currentIndex.'&action=importtheme&token='.$this->token, @@ -744,8 +746,6 @@ class AdminThemesControllerCore extends AdminController $title = implode(' '.Configuration::get('PS_NAVIGATION_PIPE').' ', $this->toolbar_title); $this->page_header_toolbar_title = $title; - - parent::initPageHeaderToolbar(); } private function checkParentClass($name) From 149a3b1101e8163c454a2f88b025b41f9ecc9a81 Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Tue, 4 Apr 2023 13:31:39 +0530 Subject: [PATCH 12/37] fix syntax issus on admin import page --- controllers/admin/AdminImportController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/admin/AdminImportController.php b/controllers/admin/AdminImportController.php index be4f42fab..5ddf08b05 100644 --- a/controllers/admin/AdminImportController.php +++ b/controllers/admin/AdminImportController.php @@ -2110,7 +2110,7 @@ class AdminImportControllerCore extends AdminController Tools::displayError('%s cannot be saved'), (isset($image->id_product) ? ' ('.$image->id_product.')' : '') ); - $this->errors[] = ($field_error !== true ? $field_error : '').(isset($lang_field_error) && $lang_field_error !== true ? $lang_field_error : '').Db::getInstance()->getMsgError()(); + $this->errors[] = ($field_error !== true ? $field_error : '').(isset($lang_field_error) && $lang_field_error !== true ? $lang_field_error : '').Db::getInstance()->getMsgError(); } } } From 48ab004e55e09ae4789b00d22dd0f5c4c6e9d656 Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Tue, 4 Apr 2023 15:03:15 +0530 Subject: [PATCH 13/37] added occupancy validation --- classes/Validate.php | 45 +++++++++++++++++++ controllers/front/CategoryController.php | 8 +++- controllers/front/ProductController.php | 7 +-- .../AdminHotelRoomsBookingController.php | 8 ++-- .../classes/WkRoomSearchHelper.php | 24 +++++----- 5 files changed, 74 insertions(+), 18 deletions(-) diff --git a/classes/Validate.php b/classes/Validate.php index 3446c5238..c8ef7f0ee 100644 --- a/classes/Validate.php +++ b/classes/Validate.php @@ -706,6 +706,51 @@ class ValidateCore return $id === null || Validate::isUnsignedId($id); } + public static function isOccupancies($occupancies) + { + if (is_array($occupancies)) { + if (count(array_filter(array_keys($occupancies), 'is_string'))) { + return Validate::isOccupancy($occupancies); + } else { + $response = true; + foreach ($occupancies as $key => $occupancy) { + $response = $response && Validate::isOccupancy($occupancy); + } + return $response; + } + } + return false; + } + + public static function isOccupancy($occupancy) + { + if (is_array($occupancy)) { + if (!isset($occupancy['adults']) || !$occupancy['adults'] || !Validate::isUnsignedInt($occupancy['adults'])) { + return false; + } + if (isset($occupancy['children'])) { + if (!Validate::isUnsignedInt($occupancy['children'])) { + return false; + } + if ($occupancy['children'] > 0) { + if (!isset($occupancy['child_ages']) || ($occupancy['children'] != count($occupancy['child_ages'])) || !is_array($occupancy['child_ages'])) { + return false; + } else { + if (is_array($occupancy['child_ages'])) { + foreach($occupancy['child_ages'] as $childAge) { + if (!Validate::isUnsignedInt($childAge)) { + return false; + } + } + } + } + } + } + return true; + } + return false; + } + /** * Check object validity * diff --git a/controllers/front/CategoryController.php b/controllers/front/CategoryController.php index 79a61fbd3..21a3ea7e9 100644 --- a/controllers/front/CategoryController.php +++ b/controllers/front/CategoryController.php @@ -159,7 +159,9 @@ class CategoryControllerCore extends FrontController // get occupancy of the search $occupancy = Tools::getValue('occupancy'); - + if (!Validate::isOccupancies($occupancy)) { + $occupancy = array(); + } $currency = new Currency($this->context->currency->id); if ($id_hotel = HotelBranchInformation::getHotelIdByIdCategory($id_category)) { @@ -267,7 +269,9 @@ class CategoryControllerCore extends FrontController // occupancy of the search $occupancy = Tools::getValue('occupancy'); - + if (!Validate::isOccupancies($occupancy)) { + $occupancy = array(); + } $sort_by = Tools::getValue('sort_by'); $sort_value = Tools::getValue('sort_value'); $filter_data = Tools::getValue('filter_data'); diff --git a/controllers/front/ProductController.php b/controllers/front/ProductController.php index 9bb0ba5f0..0e6d66681 100644 --- a/controllers/front/ProductController.php +++ b/controllers/front/ProductController.php @@ -1218,14 +1218,15 @@ class ProductControllerCore extends FrontController $dateFrom = Tools::getValue('date_from'); $dateTo = Tools::getValue('date_to'); $occupancy = Tools::getValue('occupancy'); + if (!Validate::isOccupancies($occupancy)) { + $occupancy = array(); + } $roomTypeDemands = Tools::getValue('room_type_demands'); $roomServiceProducts = Tools::getValue('room_service_products'); $dateFrom = date('Y-m-d', strtotime($dateFrom)); $dateTo = date('Y-m-d', strtotime($dateTo)); - if ($occupancy == false) { - $occupancy = array(); - } + $this->assignServiceProductVars(); if ($this->assignBookingFormVars( $idProduct, diff --git a/modules/hotelreservationsystem/controllers/admin/AdminHotelRoomsBookingController.php b/modules/hotelreservationsystem/controllers/admin/AdminHotelRoomsBookingController.php index 62f0baaea..7bfcd1234 100644 --- a/modules/hotelreservationsystem/controllers/admin/AdminHotelRoomsBookingController.php +++ b/modules/hotelreservationsystem/controllers/admin/AdminHotelRoomsBookingController.php @@ -122,9 +122,8 @@ class AdminHotelRoomsBookingController extends ModuleAdminController $id_room_type = 0; } - if (Tools::getValue('occupancy')) { - $occupancy = Tools::getValue('occupancy'); - } else { + $occupancy = Tools::getValue('occupancy'); + if (!Validate::isOccupancies($occupancy)) { $occupancy = array(); } @@ -616,6 +615,9 @@ class AdminHotelRoomsBookingController extends ModuleAdminController $date_from = Tools::getValue('date_from'); $date_to = Tools::getValue('date_to'); $occupancy = Tools::getValue('occupancy'); + if (!Validate::isOccupancies($occupancy)) { + $occupancy = array(); + } $date_from = date("Y-m-d", strtotime($date_from)); $date_to = date("Y-m-d", strtotime($date_to)); diff --git a/modules/wkroomsearchblock/classes/WkRoomSearchHelper.php b/modules/wkroomsearchblock/classes/WkRoomSearchHelper.php index ea14b1bca..452b23d64 100644 --- a/modules/wkroomsearchblock/classes/WkRoomSearchHelper.php +++ b/modules/wkroomsearchblock/classes/WkRoomSearchHelper.php @@ -183,16 +183,20 @@ class WkRoomSearchHelper if ($occupancyEnabled) { // send occupancy information searched by the user - if ($searchedData['occupancies'] = Tools::getvalue('occupancy')) { - $searchedData['occupancy_adults'] = array_sum( - array_column($searchedData['occupancies'], 'adults') - ); - $searchedData['occupancy_children'] = array_sum( - array_column($searchedData['occupancies'], 'children') - ); - $searchedData['occupancy_child_ages'] = array_sum( - array_column($searchedData['occupancies'], 'child_ages') - ); + if ($occupancies = Tools::getvalue('occupancy')) { + if (Validate::isOccupancies($occupancies)) { + if ($searchedData['occupancies'] = $occupancies) { + $searchedData['occupancy_adults'] = array_sum( + array_column($searchedData['occupancies'], 'adults') + ); + $searchedData['occupancy_children'] = array_sum( + array_column($searchedData['occupancies'], 'children') + ); + $searchedData['occupancy_child_ages'] = array_sum( + array_column($searchedData['occupancies'], 'child_ages') + ); + } + } } } $smartyVars['search_data'] = $searchedData; From 17f182aa5e2d2e33f2377aa46a0427ebb278d2af Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Tue, 4 Apr 2023 16:44:36 +0530 Subject: [PATCH 14/37] updated variables translations for js --- classes/Tools.php | 5 +- classes/Translate.php | 8 +-- classes/module/Module.php | 4 +- .../classes/HotelHelper.php | 22 ++++---- .../admin/AdminAddHotelController.php | 4 +- .../AdminHotelGeneralSettingsController.php | 2 +- .../AdminHotelRoomsBookingController.php | 52 +++++++++---------- modules/qlohotelreview/qlohotelreview.php | 2 +- .../AdminAboutHotelBlockSettingController.php | 2 +- .../AdminFeaturesModuleSettingController.php | 2 +- .../wkhotelfilterblock/wkhotelfilterblock.php | 2 +- .../wkroomsearchblock/wkroomsearchblock.php | 40 +++++++------- ...minTestimonialsModuleSettingController.php | 2 +- 13 files changed, 75 insertions(+), 72 deletions(-) diff --git a/classes/Tools.php b/classes/Tools.php index 8212ec4b0..f71f8c4a4 100644 --- a/classes/Tools.php +++ b/classes/Tools.php @@ -957,7 +957,7 @@ class ToolsCore * @param string $string Error message * @param bool $htmlentities By default at true for parsing error message with htmlentities */ - public static function displayError($string = 'Fatal error', $htmlentities = true, Context $context = null) + public static function displayError($string = 'Fatal error', $htmlentities = true, Context $context = null, $addslashes = false) { global $_ERRORS; @@ -975,6 +975,9 @@ class ToolsCore } $key = md5(str_replace('\'', '\\\'', $string)); $str = (isset($_ERRORS) && is_array($_ERRORS) && array_key_exists($key, $_ERRORS)) ? $_ERRORS[$key] : $string; + if ($addslashes) { + $str = addslashes($str); + } return $htmlentities ? Tools::htmlentitiesUTF8(stripslashes($str)) : $str; } diff --git a/classes/Translate.php b/classes/Translate.php index 810fcf0f3..fbd62ce8a 100644 --- a/classes/Translate.php +++ b/classes/Translate.php @@ -126,7 +126,7 @@ class TranslateCore * @param string $source * @return string */ - public static function getModuleTranslation($module, $string, $source, $sprintf = null, $js = false, $language = null) + public static function getModuleTranslation($module, $string, $source, $sprintf = null, $addslashes = false, $language = null) { global $_MODULES, $_MODULE, $_LANGADM; @@ -210,10 +210,10 @@ class TranslateCore $ret = Translate::checkAndReplaceArgs($ret, $sprintf); } - if ($js) { + + $ret = htmlspecialchars($ret, ENT_COMPAT, 'UTF-8'); + if ($addslashes) { $ret = addslashes($ret); - } else { - $ret = htmlspecialchars($ret, ENT_COMPAT, 'UTF-8'); } if ($sprintf === null) { diff --git a/classes/module/Module.php b/classes/module/Module.php index 5a0a591a6..04c4a2cbe 100644 --- a/classes/module/Module.php +++ b/classes/module/Module.php @@ -2124,13 +2124,13 @@ abstract class ModuleCore * @param bool|string $specific filename to use in translation key * @return string Translation */ - public function l($string, $specific = false) + public function l($string, $specific = false, $addslashes = false) { if (self::$_generate_config_xml_mode) { return $string; } - return Translate::getModuleTranslation($this, $string, ($specific) ? $specific : $this->name); + return Translate::getModuleTranslation($this, $string, ($specific) ? $specific : $this->name, null, $addslashes); } /* diff --git a/modules/hotelreservationsystem/classes/HotelHelper.php b/modules/hotelreservationsystem/classes/HotelHelper.php index 97cbb5398..b3d60de77 100644 --- a/modules/hotelreservationsystem/classes/HotelHelper.php +++ b/modules/hotelreservationsystem/classes/HotelHelper.php @@ -24,17 +24,17 @@ class HotelHelper { $objModule = new HotelreservationSystem(); $jsVars = array( - 'display_name' => $objModule->l('Display', 'HotelHelper'), - 'records_name' => $objModule->l('records per page', 'HotelHelper'), - 'no_product' => $objModule->l('No records found', 'HotelHelper'), - 'show_page' => $objModule->l('Showing page', 'HotelHelper'), - 'show_of' => $objModule->l('of', 'HotelHelper'), - 'no_record' => $objModule->l('No records available', 'HotelHelper'), - 'filter_from' => $objModule->l('filtered from', 'HotelHelper'), - 't_record' => $objModule->l('total records', 'HotelHelper'), - 'search_item' => $objModule->l('Search', 'HotelHelper'), - 'p_page' => $objModule->l('Previous', 'HotelHelper'), - 'n_page' => $objModule->l('Next', 'HotelHelper'), + 'display_name' => $objModule->l('Display', 'HotelHelper', fasle, true), + 'records_name' => $objModule->l('records per page', 'HotelHelper', fasle, true), + 'no_product' => $objModule->l('No records found', 'HotelHelper', fasle, true), + 'show_page' => $objModule->l('Showing page', 'HotelHelper', fasle, true), + 'show_of' => $objModule->l('of', 'HotelHelper', fasle, true), + 'no_record' => $objModule->l('No records available', 'HotelHelper', fasle, true), + 'filter_from' => $objModule->l('filtered from', 'HotelHelper', fasle, true), + 't_record' => $objModule->l('total records', 'HotelHelper', fasle, true), + 'search_item' => $objModule->l('Search', 'HotelHelper', fasle, true), + 'p_page' => $objModule->l('Previous', 'HotelHelper', fasle, true), + 'n_page' => $objModule->l('Next', 'HotelHelper', fasle, true), ); Media::addJsDef($jsVars); diff --git a/modules/hotelreservationsystem/controllers/admin/AdminAddHotelController.php b/modules/hotelreservationsystem/controllers/admin/AdminAddHotelController.php index 4fdb1bdec..30ffa5075 100644 --- a/modules/hotelreservationsystem/controllers/admin/AdminAddHotelController.php +++ b/modules/hotelreservationsystem/controllers/admin/AdminAddHotelController.php @@ -724,11 +724,11 @@ class AdminAddHotelController extends ModuleAdminController Media::addJsDef( array( - 'filesizeError' => $this->l('File exceeds maximum size.'), + 'filesizeError' => $this->l('File exceeds maximum size.', null, true), 'maxSizeAllowed' => Tools::getMaxUploadSize(), 'sortRowsUrl' => $this->context->link->getAdminLink('AdminAddHotel'), 'primaryHotelId' => Configuration::get('WK_PRIMARY_HOTEL'), - 'disableHotelMsg' => $this->l('Primary hotel for website will be updated to first available active hotel.'), + 'disableHotelMsg' => $this->l('Primary hotel for website will be updated to first available active hotel.', null, true), ) ); // GOOGLE MAP diff --git a/modules/hotelreservationsystem/controllers/admin/AdminHotelGeneralSettingsController.php b/modules/hotelreservationsystem/controllers/admin/AdminHotelGeneralSettingsController.php index e51f9911f..74e120141 100644 --- a/modules/hotelreservationsystem/controllers/admin/AdminHotelGeneralSettingsController.php +++ b/modules/hotelreservationsystem/controllers/admin/AdminHotelGeneralSettingsController.php @@ -419,7 +419,7 @@ class AdminHotelGeneralSettingsController extends ModuleAdminController parent::setMedia(); Media::addJsDef( array( - 'filesizeError' => $this->l('File exceeds maximum size.'), + 'filesizeError' => $this->l('File exceeds maximum size.', null, true), 'maxSizeAllowed' => Tools::getMaxUploadSize(), ) ); diff --git a/modules/hotelreservationsystem/controllers/admin/AdminHotelRoomsBookingController.php b/modules/hotelreservationsystem/controllers/admin/AdminHotelRoomsBookingController.php index 62f0baaea..1aff766be 100644 --- a/modules/hotelreservationsystem/controllers/admin/AdminHotelRoomsBookingController.php +++ b/modules/hotelreservationsystem/controllers/admin/AdminHotelRoomsBookingController.php @@ -807,33 +807,33 @@ class AdminHotelRoomsBookingController extends ModuleAdminController 'max_child_in_room' => Configuration::get('WK_GLOBAL_MAX_CHILD_IN_ROOM'), 'occupancy_required_for_booking' => $occupancyRequiredForBooking, 'rooms_booking_url' => $this->context->link->getAdminLink('AdminHotelRoomsBooking'), - 'opt_select_all' => $this->l('All Types'), - 'slt_another_htl' => $this->l('Select Another Hotel'), - 'product_type_cond' => $this->l('Product type is required'), - 'from_date_cond' => $this->l('From date is required'), - 'to_date_cond' => $this->l('To date is required'), - 'hotel_name_cond' => $this->l('Hotel Name is required'), - 'num_rooms_cond' => $this->l('Number of Rooms is required'), - 'add_to_cart' => $this->l('Add To Cart'), - 'remove' => $this->l('Remove'), - 'noRoomTypeAvlTxt' => $this->l('No room type available.'), - 'no_rm_avail_txt' => $this->l('No rooms available.'), - 'slct_rm_err' => $this->l('Please select a room first.'), - 'product_added_cart_txt' => $this->l('Product added in cart'), + 'opt_select_all' => $this->l('All Types', null, true), + 'slt_another_htl' => $this->l('Select Another Hotel', null, true), + 'product_type_cond' => $this->l('Product type is required', null, true), + 'from_date_cond' => $this->l('From date is required', null, true), + 'to_date_cond' => $this->l('To date is required', null, true), + 'hotel_name_cond' => $this->l('Hotel Name is required', null, true), + 'num_rooms_cond' => $this->l('Number of Rooms is required', null, true), + 'add_to_cart' => $this->l('Add To Cart', null, true), + 'remove' => $this->l('Remove', null, true), + 'noRoomTypeAvlTxt' => $this->l('No room type available.', null, true), + 'no_rm_avail_txt' => $this->l('No rooms available.', null, true), + 'slct_rm_err' => $this->l('Please select a room first.', null, true), + 'product_added_cart_txt' => $this->l('Product added in cart', null, true), 'info_icon_path' => _MODULE_DIR_.$this->module->name.'/views/img/Slices/info-icon.svg', - 'select_age_txt' => 'Select age', - 'under_1_age' => 'Under 1', - 'room_txt' => 'Room', - 'rooms_txt' => 'Rooms', - 'remove_txt' => 'Remove', - 'adult_txt' => 'Adults', - 'adults_txt' => 'Adults', - 'child_txt' => 'Child', - 'children_txt' => 'Children', - 'below_txt' => 'Below', - 'years_txt' => 'years', - 'all_children_txt' => 'All Children', - 'invalid_occupancy_txt' => 'Invalid occupancy(adults/children) found.', + 'select_age_txt' => $this->l('Select age', null, true), + 'under_1_age' => $this->l('Under 1', null, true), + 'room_txt' => $this->l('Room', null, true), + 'rooms_txt' => $this->l('Rooms', null, true), + 'remove_txt' => $this->l('Remove', null, true), + 'adult_txt' => $this->l('Adults', null, true), + 'adults_txt' => $this->l('Adults', null, true), + 'child_txt' => $this->l('Child', null, true), + 'children_txt' => $this->l('Children', null, true), + 'below_txt' => $this->l('Below', null, true), + 'years_txt' => $this->l('years', null, true), + 'all_children_txt' => $this->l('All Children', null, true), + 'invalid_occupancy_txt' => $this->l('Invalid occupancy(adults/children) found.', null, true), // 'check_calender_var' => $check_calender_var, ); if (Configuration::get('PS_BACKOFFICE_SEARCH_TYPE') == HotelBookingDetail::SEARCH_TYPE_OWS ) { diff --git a/modules/qlohotelreview/qlohotelreview.php b/modules/qlohotelreview/qlohotelreview.php index a0319941e..2185bd243 100644 --- a/modules/qlohotelreview/qlohotelreview.php +++ b/modules/qlohotelreview/qlohotelreview.php @@ -171,7 +171,7 @@ class QloHotelReview extends Module 'admin_approval_enabled' => (int) Configuration::get('QHR_ADMIN_APPROVAL_ENABLED'), 'texts' => array( 'num_files' => sprintf( - $this->l('You can upload a maximum of %d images.'), + $this->l('You can upload a maximum of %d images.', false, true), (int) Configuration::get('QHR_MAX_IMAGES_PER_REVIEW') ), ), diff --git a/modules/wkabouthotelblock/controllers/admin/AdminAboutHotelBlockSettingController.php b/modules/wkabouthotelblock/controllers/admin/AdminAboutHotelBlockSettingController.php index f6c973b30..8ffe12603 100644 --- a/modules/wkabouthotelblock/controllers/admin/AdminAboutHotelBlockSettingController.php +++ b/modules/wkabouthotelblock/controllers/admin/AdminAboutHotelBlockSettingController.php @@ -397,7 +397,7 @@ class AdminAboutHotelBlockSettingController extends ModuleAdminController parent::setMedia(); Media::addJsDef( array( - 'filesizeError' => $this->l('File exceeds maximum size.'), + 'filesizeError' => $this->l('File exceeds maximum size.', null, true), 'maxSizeAllowed' => Tools::getMaxUploadSize(), ) ); diff --git a/modules/wkhotelfeaturesblock/controllers/admin/AdminFeaturesModuleSettingController.php b/modules/wkhotelfeaturesblock/controllers/admin/AdminFeaturesModuleSettingController.php index 5577e9fc0..510e448c7 100644 --- a/modules/wkhotelfeaturesblock/controllers/admin/AdminFeaturesModuleSettingController.php +++ b/modules/wkhotelfeaturesblock/controllers/admin/AdminFeaturesModuleSettingController.php @@ -428,7 +428,7 @@ class AdminFeaturesModuleSettingController extends ModuleAdminController parent::setMedia(); Media::addJsDef( array( - 'filesizeError' => $this->l('File exceeds maximum size.'), + 'filesizeError' => $this->l('File exceeds maximum size.', null, true), 'maxSizeAllowed' => Tools::getMaxUploadSize(), ) ); diff --git a/modules/wkhotelfilterblock/wkhotelfilterblock.php b/modules/wkhotelfilterblock/wkhotelfilterblock.php index 21d094a29..8f6dafcd6 100644 --- a/modules/wkhotelfilterblock/wkhotelfilterblock.php +++ b/modules/wkhotelfilterblock/wkhotelfilterblock.php @@ -66,7 +66,7 @@ class wkhotelfilterblock extends Module $htl_id_category = Tools::getValue('id_category'); if (Validate::isLoadedObject($objCategory = new Category((int) $htl_id_category))) { if ($objCategory->hasParent(Configuration::get('PS_LOCATIONS_CATEGORY'))) { - Media::addJsDef(array('noRoomAvailTxt' => $this->l('No room available'))); + Media::addJsDef(array('noRoomAvailTxt' => $this->l('No room available', false, true))); $this->context->controller->addJS($this->_path.'/views/js/wkhotelfilterblock.js'); $this->context->controller->addCSS($this->_path.'/views/css/wkhotelfilterblock.css'); diff --git a/modules/wkroomsearchblock/wkroomsearchblock.php b/modules/wkroomsearchblock/wkroomsearchblock.php index 256d0d15f..e959bf65d 100644 --- a/modules/wkroomsearchblock/wkroomsearchblock.php +++ b/modules/wkroomsearchblock/wkroomsearchblock.php @@ -61,26 +61,26 @@ class WkRoomSearchBlock extends Module 'wkroomsearchblock', 'autocompletesearch' ), - 'no_results_found_cond' => $this->l('No results found for this search'), - 'hotel_name_cond' => $this->l('Please select a hotel name'), - 'check_in_time_cond' => $this->l('Please enter Check In time'), - 'check_out_time_cond' => $this->l('Please enter Check Out time'), - 'less_checkin_date' => $this->l('Check In date can not be before current date.'), - 'more_checkout_date' => $this->l('Check Out date must be greater than Check In date.'), - 'select_htl_txt' => $this->l('Select Hotel'), - 'select_age_txt' => $this->l('Select age'), - 'under_1_age' => $this->l('Under 1'), - 'room_txt' => $this->l('Room'), - 'rooms_txt' => $this->l('Rooms'), - 'remove_txt' => $this->l('Remove'), - 'adult_txt' => $this->l('Adult'), - 'adults_txt' => $this->l('Adults'), - 'child_txt' => $this->l('Child'), - 'children_txt' => $this->l('Children'), - 'below_txt' => $this->l('Below'), - 'years_txt' => $this->l('years'), - 'all_children_txt' => $this->l('All Children'), - 'invalid_occupancy_txt' => $this->l('Invalid occupancy(adults/children) found.'), + 'no_results_found_cond' => $this->l('No results found for this search', false, true), + 'hotel_name_cond' => $this->l('Please select a hotel name', false, true), + 'check_in_time_cond' => $this->l('Please enter Check In time', false, true), + 'check_out_time_cond' => $this->l('Please enter Check Out time', false, true), + 'less_checkin_date' => $this->l('Check In date can not be before current date.', false, true), + 'more_checkout_date' => $this->l('Check Out date must be greater than Check In date.', false, true), + 'select_htl_txt' => $this->l('Select Hotel', false, true), + 'select_age_txt' => $this->l('Select age', false, true), + 'under_1_age' => $this->l('Under 1', false, true), + 'room_txt' => $this->l('Room', false, true), + 'rooms_txt' => $this->l('Rooms', false, true), + 'remove_txt' => $this->l('Remove', false, true), + 'adult_txt' => $this->l('Adult', false, true), + 'adults_txt' => $this->l('Adults', false, true), + 'child_txt' => $this->l('Child', false, true), + 'children_txt' => $this->l('Children', false, true), + 'below_txt' => $this->l('Below', false, true), + 'years_txt' => $this->l('years', false, true), + 'all_children_txt' => $this->l('All Children', false, true), + 'invalid_occupancy_txt' => $this->l('Invalid occupancy(adults/children) found.', false, true), ) ); } diff --git a/modules/wktestimonialblock/controllers/admin/AdminTestimonialsModuleSettingController.php b/modules/wktestimonialblock/controllers/admin/AdminTestimonialsModuleSettingController.php index 83c2c9c19..2bffd0fd9 100644 --- a/modules/wktestimonialblock/controllers/admin/AdminTestimonialsModuleSettingController.php +++ b/modules/wktestimonialblock/controllers/admin/AdminTestimonialsModuleSettingController.php @@ -406,7 +406,7 @@ class AdminTestimonialsModuleSettingController extends ModuleAdminController parent::setMedia(); Media::addJsDef( array( - 'filesizeError' => $this->l('File exceeds maximum size.'), + 'filesizeError' => $this->l('File exceeds maximum size.', null, true), 'maxSizeAllowed' => Tools::getMaxUploadSize(), ) ); From 4a13d38775b5d59a472ed3c996467e853697bc61 Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Tue, 4 Apr 2023 19:32:08 +0530 Subject: [PATCH 15/37] fixed undefined index in services panel --- .../default/template/controllers/products/serviceproduct.tpl | 4 ++-- controllers/admin/AdminProductsController.php | 1 - js/admin/products.js | 1 - 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/admin/themes/default/template/controllers/products/serviceproduct.tpl b/admin/themes/default/template/controllers/products/serviceproduct.tpl index be79c8694..668c5e0d6 100644 --- a/admin/themes/default/template/controllers/products/serviceproduct.tpl +++ b/admin/themes/default/template/controllers/products/serviceproduct.tpl @@ -57,7 +57,7 @@ {if isset($service_product.tax_rules_group_name) && $service_product.tax_rules_group_name}{$service_product.tax_rules_group_name}{else}{$service_product.default_tax_rules_group_name}{/if} {/if} - {if isset($total_extra_services)} + {if isset($total_convenience_fee)}
- {convertPrice price=$total_extra_services} - {l s='Extra Services Cost' mod='blockcart'} + {convertPrice price=$total_convenience_fee} + {l s='Convenience Fees' mod='blockcart'}
{/if}
@@ -314,7 +314,7 @@ {/if} {/if} - + {if $cart_qties > 0} {convertPrice price=$cart->getOrderTotal(false, Cart::ONLY_PRODUCTS)} {/if} @@ -354,16 +354,16 @@ {/if}
--> - {if isset($total_extra_services)} + {if isset($total_convenience_fee)}
- {l s='Total Extra Services Cost' mod='blockcart'} - {convertPrice price=$total_extra_services} + {l s='Convenience Fees' mod='blockcart'} + {convertPrice price=$total_convenience_fee}
{/if} {if $show_tax && $use_tax}
{l s='Tax' mod='blockcart'} - {$tax_cost} + {$tax_cost}
{/if}
@@ -377,7 +377,7 @@ {/if} {/if} - + {if $cart_qties > 0} {if $priceDisplay == 1} {convertPrice price=$cart->getOrderTotal(false)} diff --git a/themes/hotel-reservation-theme/css/modules/blockcart/blockcart.css b/themes/hotel-reservation-theme/css/modules/blockcart/blockcart.css index f4fc05baa..35e18d341 100644 --- a/themes/hotel-reservation-theme/css/modules/blockcart/blockcart.css +++ b/themes/hotel-reservation-theme/css/modules/blockcart/blockcart.css @@ -226,7 +226,7 @@ .cart_block .cart_block_tax_cost, .cart_block .cart_block_total, .cart_block .cart_block_wrapping_cost, -.cart_block .cart_block_additional_facilities_cost { +.cart_block .cart_block_convenience_fee { float: right; } .cart_block table.vouchers { diff --git a/themes/hotel-reservation-theme/js/modules/blockcart/ajax-cart.js b/themes/hotel-reservation-theme/js/modules/blockcart/ajax-cart.js index b23f26b68..bf5b7f96b 100644 --- a/themes/hotel-reservation-theme/js/modules/blockcart/ajax-cart.js +++ b/themes/hotel-reservation-theme/js/modules/blockcart/ajax-cart.js @@ -912,7 +912,7 @@ var ajaxCart = { content += ''; content += '' + $.datepicker.formatDate(ajaxCart.dateFormat, new Date(date_diff_v.data_form)) + ' - ' + $.datepicker.formatDate(ajaxCart.dateFormat, new Date(date_diff_v.data_to)) + ''; content += '' + date_diff_v.num_rm + ''; - content += '' + formatCurrency(parseFloat(date_diff_v.amount), currency_format, currency_sign, currency_blank) + ''; + content += '' + formatCurrency(parseFloat(date_diff_v.amount) + parseFloat(date_diff_v.demand_price), currency_format, currency_sign, currency_blank) + ''; content += ''; content += ''; content += ''; @@ -949,7 +949,7 @@ var ajaxCart = { booking_dates_content += ''; booking_dates_content += '' + $.datepicker.formatDate(ajaxCart.dateFormat, new Date(date_diff_v1.data_form)) + ' - ' + $.datepicker.formatDate(ajaxCart.dateFormat, new Date(date_diff_v1.data_to)) + ''; booking_dates_content += '' + date_diff_v1.num_rm + ''; - booking_dates_content += '' + formatCurrency(parseFloat(date_diff_v1.amount), currency_format, currency_sign, currency_blank) + ''; + booking_dates_content += '' + formatCurrency(parseFloat(date_diff_v1.amount) + parseFloat(date_diff_v1.demand_price), currency_format, currency_sign, currency_blank) + ''; booking_dates_content += ''; booking_dates_content += ''; booking_dates_content += ''; @@ -1154,16 +1154,20 @@ var ajaxCart = { if (hasDeliveryAddress) $('.ajax_cart_shipping_cost').parent().find('.unvisible').show(); - $('.ajax_cart_tax_cost').text(jsonData.taxCost); + $('.ajax_cart_tax_cost').text(jsonData.tax_cost); $('.cart_block_wrapping_cost').text(jsonData.wrapping_cost); $('.ajax_block_cart_total').text(jsonData.total); $('.ajax_block_cart_total').attr('total_cart_price', jsonData.totalToPay); - $('.ajax_block_products_total').text(jsonData.product_total); - $('.ajax_block_room_total').text(jsonData.roomTotal); + $('.ajax_block_room_total').text(jsonData.room_total); $('.ajax_block_nornal_products_total').text(jsonData.normalProductsTotal); - $('.ajax_cart_extra_demands_cost').text(jsonData.total_extra_services_format); + $('.ajax_cart_convenience_fee').text(jsonData.total_convenience_fee_format); + if (jsonData.total_convenience_fee) { + $('.ajax_cart_convenience_fee').parent().show(); + } else { + $('.ajax_cart_convenience_fee').parent().hide(); + } $('.ajax_total_price_wt').text(jsonData.total_price_wt); if (parseFloat(jsonData.free_shipping_float) > 0) { diff --git a/themes/hotel-reservation-theme/modules/blockcart/blockcart.tpl b/themes/hotel-reservation-theme/modules/blockcart/blockcart.tpl index 6c64c9c3b..bbeb68201 100644 --- a/themes/hotel-reservation-theme/modules/blockcart/blockcart.tpl +++ b/themes/hotel-reservation-theme/modules/blockcart/blockcart.tpl @@ -124,7 +124,7 @@ {$data_v['data_form']|date_format:"%d-%m-%Y"} - {$data_v['data_to']|date_format:"%d-%m-%Y"} {$data_v['num_rm']} - {convertPrice price=$data_v['amount']} + {convertPrice price=($data_v['amount'] + $data_v['demand_price'])} {/foreach} @@ -222,10 +222,10 @@ {l s='Tax' mod='blockcart'}
{/if} - {if isset($total_extra_services)} + {if isset($total_convenience_fee)}
- {convertPrice price=$total_extra_services} - {l s='Extra Services Cost' mod='blockcart'} + {convertPrice price=$total_convenience_fee} + {l s='Convenience Fees' mod='blockcart'}
{/if}
@@ -314,7 +314,7 @@ {/if} {/if} - + {if $cart_qties > 0} {convertPrice price=$cart->getOrderTotal(false, Cart::ONLY_PRODUCTS)} {/if} @@ -354,16 +354,16 @@ {/if}
--> - {if isset($total_extra_services)} + {if isset($total_convenience_fee)}
- {l s='Total Extra Services Cost' mod='blockcart'} - {convertPrice price=$total_extra_services} + {l s='Convenience Fees' mod='blockcart'} + {convertPrice price=$total_convenience_fee}
{/if} {if $show_tax && $use_tax}
{l s='Tax' mod='blockcart'} - {$tax_cost} + {$tax_cost}
{/if}
@@ -377,7 +377,7 @@ {/if} {/if} - + {if $cart_qties > 0} {if $priceDisplay == 1} {convertPrice price=$cart->getOrderTotal(false)} From 724c2d85616d2bf46f82d9bf852461d4cb9ef5dc Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Thu, 6 Apr 2023 16:52:19 +0530 Subject: [PATCH 33/37] updated checkout page auto add service breakdown tooltip --- .../hotel-reservation-theme/js/order-opc.js | 60 ++++++++++--------- 1 file changed, 31 insertions(+), 29 deletions(-) diff --git a/themes/hotel-reservation-theme/js/order-opc.js b/themes/hotel-reservation-theme/js/order-opc.js index 45e846505..bc79fef42 100644 --- a/themes/hotel-reservation-theme/js/order-opc.js +++ b/themes/hotel-reservation-theme/js/order-opc.js @@ -35,38 +35,40 @@ $(document).ready(function() // room price details tooltip if ($('.room_price_detail_block .room-price-detail').length) { - $('.room_price_detail_block .room-price-detail img').tooltip({ - content: $('.room_price_detail_block .room-price-detail-container').html(), - items: "span", - trigger : 'hover', - tooltipClass: "room-price-detail-tooltip", - open: function(event, ui) - { - if (typeof(event.originalEvent) === 'undefined') + $('.room_price_detail_block .room-price-detail').each(function (i, element) { + $(this).find('img').tooltip({ + content: $(this).closest('.price_block').find('.room-price-detail-container').html(), + items: "span", + trigger : 'hover', + tooltipClass: "room-price-detail-tooltip", + open: function(event, ui) { - return false; - } - - var $id = $(ui.tooltip).attr('id'); - - if ($('div.ui-tooltip').not('#' + $id).length) { - return false; - } - }, - close: function(event, ui) - { - ui.tooltip.hover(function() - { - $(this).stop(true).fadeTo(400, 1); - }, - function() - { - $(this).fadeOut('400', function() + if (typeof(event.originalEvent) === 'undefined') { - $(this).remove(); + return false; + } + + var $id = $(ui.tooltip).attr('id'); + + if ($('div.ui-tooltip').not('#' + $id).length) { + return false; + } + }, + close: function(event, ui) + { + ui.tooltip.hover(function() + { + $(this).stop(true).fadeTo(400, 1); + }, + function() + { + $(this).fadeOut('400', function() + { + $(this).remove(); + }); }); - }); - } + } + }); }); } From 16830077705a8832190ba8708596aac3ea9b2a4e Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Thu, 6 Apr 2023 16:55:44 +0530 Subject: [PATCH 34/37] Fix PHP warning issue in catalog mode --- .../hotelreservationsystem.php | 36 ++++++++++--------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/modules/hotelreservationsystem/hotelreservationsystem.php b/modules/hotelreservationsystem/hotelreservationsystem.php index c7f78a128..39422311b 100644 --- a/modules/hotelreservationsystem/hotelreservationsystem.php +++ b/modules/hotelreservationsystem/hotelreservationsystem.php @@ -73,23 +73,25 @@ class HotelReservationSystem extends Module date('d-m-Y', strtotime(date('Y-m-d', time()).' + 1 year')) ); } - /*To remove room from cart before todays date*/ - if (isset($this->context->cart->id) && $this->context->cart->id) { - $htlCart = new HotelCartBookingData(); - if ($cartBookingData = $htlCart->getCartBookingDetailsByIdCartIdGuest( - $this->context->cart->id, - $this->context->cart->id_guest, - $this->context->language->id - )) { - foreach ($cartBookingData as $cartRoom) { - if (strtotime($cartRoom['date_from']) < strtotime(date('Y-m-d'))) { - $htlCart->deleteRoomDataFromOrderLine( - $cartRoom['id_cart'], - $cartRoom['id_guest'], - $cartRoom['id_product'], - $cartRoom['date_from'], - $cartRoom['date_to'] - ); + if (!Configuration::get('PS_CATALOG_MODE')) { + /*To remove room from cart before todays date*/ + if (isset($this->context->cart->id) && $this->context->cart->id) { + $htlCart = new HotelCartBookingData(); + if ($cartBookingData = $htlCart->getCartBookingDetailsByIdCartIdGuest( + $this->context->cart->id, + $this->context->cart->id_guest, + $this->context->language->id + )) { + foreach ($cartBookingData as $cartRoom) { + if (strtotime($cartRoom['date_from']) < strtotime(date('Y-m-d'))) { + $htlCart->deleteRoomDataFromOrderLine( + $cartRoom['id_cart'], + $cartRoom['id_guest'], + $cartRoom['id_product'], + $cartRoom['date_from'], + $cartRoom['date_to'] + ); + } } } } From 3ae7a30c0ac7254ed8e4c31408d1eda10d93e81a Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Thu, 6 Apr 2023 18:18:39 +0530 Subject: [PATCH 35/37] Add default contact info at front office nav bar --- modules/qloblockcontact/qloblockcontact.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/qloblockcontact/qloblockcontact.php b/modules/qloblockcontact/qloblockcontact.php index c62d90851..a12c23973 100644 --- a/modules/qloblockcontact/qloblockcontact.php +++ b/modules/qloblockcontact/qloblockcontact.php @@ -41,8 +41,8 @@ class QloBlockContact extends Module public function install() { if (!parent::install() - || !Configuration::updateValue('QBC_PHONE', '') - || !Configuration::updateValue('QBC_EMAIL', '') + || !Configuration::updateValue('QBC_PHONE', Configuration::get('WK_HOTEL_GLOBAL_CONTACT_NUMBER')) + || !Configuration::updateValue('QBC_EMAIL', Configuration::get('WK_HOTEL_GLOBAL_CONTACT_EMAIL')) || !$this->registerHook('actionFrontControllerSetMedia') || !$this->registerHook('displayNav') || !$this->registerHook('displayExternalNavigationHook') From 4e2db505bbe728c904f71d6284cf5213461d2023 Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Mon, 10 Apr 2023 18:27:04 +0530 Subject: [PATCH 36/37] update current date variable --- controllers/admin/AdminCartsController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/controllers/admin/AdminCartsController.php b/controllers/admin/AdminCartsController.php index 926093c40..95da147ce 100644 --- a/controllers/admin/AdminCartsController.php +++ b/controllers/admin/AdminCartsController.php @@ -847,8 +847,9 @@ class AdminCartsControllerCore extends AdminController $cart_detail_data_obj = new HotelCartBookingData(); $cart_detail_data = $cart_detail_data_obj->getCartFormatedBookinInfoByIdCart((int) $id_cart); $is_backdate_order = false; + $currentDate = strtotime(date('Y-m-d')); foreach ($cart_detail_data as $cartRoom) { - if (strtotime($cartRoom['date_from']) < strtotime(date('Y-m-d'))) { + if (strtotime($cartRoom['date_from']) < $currentDate) { $is_backdate_order = true; } } From f0de9686b4aff3700d64f3b2d3c0c90d03e68443 Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Mon, 10 Apr 2023 18:36:08 +0530 Subject: [PATCH 37/37] fix date to update during preperation time --- themes/hotel-reservation-theme/js/product.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/themes/hotel-reservation-theme/js/product.js b/themes/hotel-reservation-theme/js/product.js index 6b4bbb46e..b4b2c2d38 100644 --- a/themes/hotel-reservation-theme/js/product.js +++ b/themes/hotel-reservation-theme/js/product.js @@ -1359,11 +1359,13 @@ var BookingForm = { if (preparation_time) { start_date.setDate(start_date.getDate() + parseInt(preparation_time)); start_date.setHours(0, 0, 0, 0); - if (dateFrom && new Date(dateFrom) < start_date) { + if (dateFrom && new Date(dateFrom + ' 00:00:00') < start_date) { dateFrom = $.datepicker.formatDate('yy-mm-dd', start_date); - dateTo = new Date(start_date); - dateTo.setDate(start_date.getDate() + 1); - dateTo = $.datepicker.formatDate('yy-mm-dd', dateTo); + if (new Date(dateTo + ' 00:00:00') <= start_date) { + dateTo = new Date(start_date); + dateTo.setDate(start_date.getDate() + 1); + dateTo = $.datepicker.formatDate('yy-mm-dd', dateTo); + } } }