From 021a003ab334d8f57c1aea1fe9779bcf2579cf11 Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Wed, 17 Apr 2024 13:09:38 +0530 Subject: [PATCH 01/13] Updated error message for guest account to customer account transformation --- controllers/front/GuestTrackingController.php | 9 +++++++-- controllers/front/OrderOpcController.php | 8 +++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/controllers/front/GuestTrackingController.php b/controllers/front/GuestTrackingController.php index ab05a2876..ad2a0cb29 100644 --- a/controllers/front/GuestTrackingController.php +++ b/controllers/front/GuestTrackingController.php @@ -95,8 +95,13 @@ class GuestTrackingControllerCore extends FrontController } elseif (!Tools::getValue('password')) { $this->errors[] = Tools::displayError('Invalid password.'); } elseif (!$customer->transformToCustomer($this->context->language->id, Tools::getValue('password'))) { - // @todo clarify error message - $this->errors[] = Tools::displayError('An error occurred while transforming a guest into a registered customer.'); + if (!$customer->isGuest()) { + $this->errors[] = Tools::displayError('This account is already registered as a customer.'); + }else if (!Validate::isPasswd(Tools::getValue('password'))) { + $this->errors[] = Tools::displayError('Invalid password.'); + } else { + $this->errors[] = Tools::displayError('An error occurred while transforming a guest into a registered customer.'); + } } else { $this->context->smarty->assign('transformSuccess', true); } diff --git a/controllers/front/OrderOpcController.php b/controllers/front/OrderOpcController.php index 465c6a7ca..e109721a6 100644 --- a/controllers/front/OrderOpcController.php +++ b/controllers/front/OrderOpcController.php @@ -176,7 +176,13 @@ class OrderOpcControllerCore extends ParentOrderController if ($customer->transformToCustomer($this->context->language->id, $passwd)) { $this->context->updateCustomer($customer); } else { - $this->errors[] = Tools::displayError('An error occurred while transforming your account into a registered customer.'); + if (!$customer->isGuest()) { + $this->errors[] = Tools::displayError('This account is already registered as a customer.'); + }else if (!Validate::isPasswd($passwd)) { + $this->errors[] = Tools::displayError('Invalid password.'); + } else { + $this->errors[] = Tools::displayError('An error occurred while transforming your account into a registered customer.'); + } } } From a316307c2ea1c6d7250f75b2db5ec6f0ea6e2bd4 Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Wed, 17 Apr 2024 16:00:52 +0530 Subject: [PATCH 02/13] Fixed: Search panel issue on room type page when hotel is disabled --- .../wkroomsearchblock/classes/WkRoomSearchHelper.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/wkroomsearchblock/classes/WkRoomSearchHelper.php b/modules/wkroomsearchblock/classes/WkRoomSearchHelper.php index 7ab3d7138..dc4ac075c 100644 --- a/modules/wkroomsearchblock/classes/WkRoomSearchHelper.php +++ b/modules/wkroomsearchblock/classes/WkRoomSearchHelper.php @@ -159,11 +159,13 @@ class WkRoomSearchHelper $searchedData['location'] = $objLocationCategory->name; } else { $locationCategoryId = $objCategory->id_parent; - $searchedData['location'] = $searchedData['htl_dtl']['city']; - if (isset($searchedData['htl_dtl']['state_name'])) { - $searchedData['location'] .= ', '.$searchedData['htl_dtl']['state_name']; + if ($searchedData['htl_dtl']) { + $searchedData['location'] = $searchedData['htl_dtl']['city']; + if (isset($searchedData['htl_dtl']['state_name'])) { + $searchedData['location'] .= ', '.$searchedData['htl_dtl']['state_name']; + } + $searchedData['location'] .= ', '.$searchedData['htl_dtl']['country_name']; } - $searchedData['location'] .= ', '.$searchedData['htl_dtl']['country_name']; } $searchedData['location_category_id'] = $locationCategoryId; From 8d5a26969692d2ab57b75b8c1baaf1a6c66ac6c6 Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Fri, 19 Apr 2024 11:21:25 +0530 Subject: [PATCH 03/13] Fixed: error on checkout if the user choses other lanuage than default language --- classes/order/OrderHistory.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/order/OrderHistory.php b/classes/order/OrderHistory.php index 874171009..1d09988c0 100644 --- a/classes/order/OrderHistory.php +++ b/classes/order/OrderHistory.php @@ -449,7 +449,7 @@ class OrderHistoryCore extends ObjectModel ); if ($idHotel = HotelBookingDetail::getIdHotelByIdOrder($order->id)) { - $objHotelBranchInformation = new HotelBranchInformation($idHotel, $order->id_lang); + $objHotelBranchInformation = new HotelBranchInformation($idHotel); $fields = array_merge( $objHotelBranchInformation->getFields(), $objHotelBranchInformation->getFieldsLang()[$order->id_lang], From 8279b0f64aa2389e6d01347ced03a9d3bfb1f4e2 Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Fri, 19 Apr 2024 16:37:17 +0530 Subject: [PATCH 04/13] Fixed: Creation of to sperate HotelAdvancedPayment for a same room type from two seprates tabs --- controllers/admin/AdminProductsController.php | 6 ++++-- .../hotelreservationsystem/classes/HotelAdvancedPayment.php | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/controllers/admin/AdminProductsController.php b/controllers/admin/AdminProductsController.php index 811207d39..6988d73bd 100644 --- a/controllers/admin/AdminProductsController.php +++ b/controllers/admin/AdminProductsController.php @@ -1089,16 +1089,18 @@ class AdminProductsControllerCore extends AdminController } $id_product = Tools::getValue('id_product'); - $id_adv_pmt = Tools::getValue('id_adv_pmt'); if ($id_adv_pmt) { $obj_adv_pmt = new HotelAdvancedPayment($id_adv_pmt); } else { $obj_adv_pmt = new HotelAdvancedPayment(); + if ($id_adv_pmt = $obj_adv_pmt->getIdAdvPaymentByIdProduct($id_product)) { + // To prevent duplication from two separate tabs + $obj_adv_pmt = new HotelAdvancedPayment($id_adv_pmt); + } } $adv_payment_active = Tools::getValue('adv_payment_active'); - $obj_adv_pmt->id_product = $id_product; $obj_adv_pmt->active = $adv_payment_active; diff --git a/modules/hotelreservationsystem/classes/HotelAdvancedPayment.php b/modules/hotelreservationsystem/classes/HotelAdvancedPayment.php index 1cc539d75..076663010 100644 --- a/modules/hotelreservationsystem/classes/HotelAdvancedPayment.php +++ b/modules/hotelreservationsystem/classes/HotelAdvancedPayment.php @@ -68,7 +68,7 @@ class HotelAdvancedPayment extends ObjectModel */ public function getIdAdvPaymentByIdProduct($id_product) { - $result = Db::getInstance()->getRow("SELECT * FROM `"._DB_PREFIX_."htl_advance_payment` WHERE `id_product`=".$id_product); + $result = Db::getInstance()->getRow("SELECT * FROM `"._DB_PREFIX_."htl_advance_payment` WHERE `id_product`=".(int) $id_product); if ($result) { return $result; From 77f68d4b7b4ee752e11e13f5f65bfc6109437858 Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Mon, 22 Apr 2024 13:10:58 +0530 Subject: [PATCH 05/13] Fixed: service products unit price not defined in cart package --- classes/Cart.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/classes/Cart.php b/classes/Cart.php index 921afd2cf..7500dd21e 100644 --- a/classes/Cart.php +++ b/classes/Cart.php @@ -2407,7 +2407,8 @@ class CartCore extends ObjectModel $product['cart_quantity'] = $selectedProduct['quantity']; $product['total'] = $selectedProduct['total_price_tax_excl']; $product['total_wt'] = $selectedProduct['total_price_tax_incl']; - $product['price_wt'] = $selectedProduct['unit_price_tax_incl']; + $product['price_wt'] = $selectedProduct['total_price_tax_incl'] / $product['cart_quantity']; + $product['price'] = $selectedProduct['total_price_tax_excl'] / $product['cart_quantity']; $product['id_hotel'] = $selectedProduct['id_hotel']; $orderPackage[$id_address][$selectedProduct['id_hotel']]['product_list'][] = $product; if (!isset($orderPackage[$id_address][$selectedProduct['id_hotel']]['id_hotel'])) { From 5a8759c4d3fe12b12a3efa56921b5b1edce12ae1 Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Mon, 22 Apr 2024 14:49:20 +0530 Subject: [PATCH 06/13] Fixed: Unable to change tax to "No Tax" for service product --- controllers/admin/AdminProductsController.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/controllers/admin/AdminProductsController.php b/controllers/admin/AdminProductsController.php index 811207d39..9f00f6c01 100644 --- a/controllers/admin/AdminProductsController.php +++ b/controllers/admin/AdminProductsController.php @@ -3178,12 +3178,8 @@ class AdminProductsControllerCore extends AdminController $objRoomTypeServiceProductPrice->id_element = $idProduct; $objRoomTypeServiceProductPrice->element_type = RoomTypeServiceProduct::WK_ELEMENT_TYPE_ROOM_TYPE; } - $objRoomTypeServiceProductPrice->price = $price; - if ($idTaxRulesGroup) { - $objRoomTypeServiceProductPrice->id_tax_rules_group = $idTaxRulesGroup; - } - + $objRoomTypeServiceProductPrice->id_tax_rules_group = $idTaxRulesGroup; $objRoomTypeServiceProductPrice->save(); } else { // create new association From 0195bc2a4d55d35e49d4d4eb0b7788b5715cd4c3 Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Mon, 22 Apr 2024 16:25:41 +0530 Subject: [PATCH 07/13] Fixed: Tax price is not calculated according to zip code in backoffice controller --- controllers/admin/AdminNormalProductsController.php | 2 +- controllers/admin/AdminProductsController.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/controllers/admin/AdminNormalProductsController.php b/controllers/admin/AdminNormalProductsController.php index 87a959951..cf78be63c 100644 --- a/controllers/admin/AdminNormalProductsController.php +++ b/controllers/admin/AdminNormalProductsController.php @@ -3079,7 +3079,7 @@ class AdminNormalProductsControllerCore extends AdminController } else { $address->id_country = (int)$address_infos['id_country']; $address->id_state = (int)$address_infos['id_state']; - $address->zipcode = $address_infos['postcode']; + $address->postcode = $address_infos['postcode']; } $tax_rules_groups = TaxRulesGroup::getTaxRulesGroups(true); $tax_rates = array( diff --git a/controllers/admin/AdminProductsController.php b/controllers/admin/AdminProductsController.php index 811207d39..6e8ed5b65 100644 --- a/controllers/admin/AdminProductsController.php +++ b/controllers/admin/AdminProductsController.php @@ -3910,7 +3910,7 @@ class AdminProductsControllerCore extends AdminController } else { $address->id_country = (int)$address_infos['id_country']; $address->id_state = (int)$address_infos['id_state']; - $address->zipcode = $address_infos['postcode']; + $address->postcode = $address_infos['postcode']; } $tax_rules_groups = TaxRulesGroup::getTaxRulesGroups(true); From 5361beca0460020783e5a10fa9c77c204b311d89 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Tue, 23 Apr 2024 12:25:33 +0530 Subject: [PATCH 08/13] Fix duplicated order ids on admin Booking Carts listing page --- controllers/admin/AdminCartsController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/controllers/admin/AdminCartsController.php b/controllers/admin/AdminCartsController.php index 8b53e911c..108b51a75 100644 --- a/controllers/admin/AdminCartsController.php +++ b/controllers/admin/AdminCartsController.php @@ -45,8 +45,8 @@ class AdminCartsControllerCore extends AdminController $this->_select = 'CONCAT(c.`firstname`, \' \', c.`lastname`) `customer`, a.id_cart total, TIME_TO_SEC(TIMEDIFF(\''.pSQL(date('Y-m-d H:i:00', time())).'\', a.`date_add`)) AS `time_diff`, - IFNULL(GROUP_CONCAT(o.`id_order`), 0) AS `ids_order`, - IF (IFNULL(o.id_order, \''.$this->l('Non ordered cart').'\') = \''.$this->l('Non ordered cart').'\', IF(TIME_TO_SEC(TIMEDIFF(\''.pSQL(date('Y-m-d H:i:00', time())).'\', a.`date_add`)) > 86400, \''.$this->l('Abandoned cart').'\', \''.$this->l('Non ordered cart').'\'), GROUP_CONCAT(o.`id_order`)) AS filter_ids_order, + IFNULL(GROUP_CONCAT(DISTINCT o.`id_order`), 0) AS `ids_order`, + IF (IFNULL(o.id_order, \''.$this->l('Non ordered cart').'\') = \''.$this->l('Non ordered cart').'\', IF(TIME_TO_SEC(TIMEDIFF(\''.pSQL(date('Y-m-d H:i:00', time())).'\', a.`date_add`)) > 86400, \''.$this->l('Abandoned cart').'\', \''.$this->l('Non ordered cart').'\'), GROUP_CONCAT(DISTINCT o.`id_order`)) AS filter_ids_order, IF(o.id_order, 1, 0) badge_success, IF(o.id_order, 0, 1) badge_danger, IF(co.id_guest, 1, 0) id_guest'; $this->_join = 'LEFT JOIN '._DB_PREFIX_.'customer c ON (c.id_customer = a.id_customer) LEFT JOIN '._DB_PREFIX_.'currency cu ON (cu.id_currency = a.id_currency) From 80f0e1758b442ac0558e8e78c82b5080f9e71b65 Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Mon, 29 Apr 2024 18:30:40 +0530 Subject: [PATCH 09/13] Removed: no required and dulicate validations --- controllers/front/GuestTrackingController.php | 12 ++++-------- controllers/front/OrderOpcController.php | 12 ++++-------- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/controllers/front/GuestTrackingController.php b/controllers/front/GuestTrackingController.php index ad2a0cb29..e7017e12f 100644 --- a/controllers/front/GuestTrackingController.php +++ b/controllers/front/GuestTrackingController.php @@ -92,16 +92,12 @@ class GuestTrackingControllerCore extends FrontController $customer = new Customer((int)$order->id_customer); if (!Validate::isLoadedObject($customer)) { $this->errors[] = Tools::displayError('Invalid customer'); - } elseif (!Tools::getValue('password')) { + } elseif (!Tools::getValue('password') + || !Validate::isPasswd(Tools::getValue('password') + )) { $this->errors[] = Tools::displayError('Invalid password.'); } elseif (!$customer->transformToCustomer($this->context->language->id, Tools::getValue('password'))) { - if (!$customer->isGuest()) { - $this->errors[] = Tools::displayError('This account is already registered as a customer.'); - }else if (!Validate::isPasswd(Tools::getValue('password'))) { - $this->errors[] = Tools::displayError('Invalid password.'); - } else { - $this->errors[] = Tools::displayError('An error occurred while transforming a guest into a registered customer.'); - } + $this->errors[] = Tools::displayError('An error occurred while transforming a guest into a registered customer.'); } else { $this->context->smarty->assign('transformSuccess', true); } diff --git a/controllers/front/OrderOpcController.php b/controllers/front/OrderOpcController.php index e109721a6..2cd2a223c 100644 --- a/controllers/front/OrderOpcController.php +++ b/controllers/front/OrderOpcController.php @@ -173,16 +173,12 @@ class OrderOpcControllerCore extends ParentOrderController if (!count($this->errors)) { $customer = new Customer($this->context->customer->id); - if ($customer->transformToCustomer($this->context->language->id, $passwd)) { + if (!$customer->isGuest()) { + $this->errors[] = Tools::displayError('This account is already registered as a customer.'); + } else if ($customer->transformToCustomer($this->context->language->id, $passwd)) { $this->context->updateCustomer($customer); } else { - if (!$customer->isGuest()) { - $this->errors[] = Tools::displayError('This account is already registered as a customer.'); - }else if (!Validate::isPasswd($passwd)) { - $this->errors[] = Tools::displayError('Invalid password.'); - } else { - $this->errors[] = Tools::displayError('An error occurred while transforming your account into a registered customer.'); - } + $this->errors[] = Tools::displayError('An error occurred while transforming your account into a registered customer.'); } } From 038e08e540a564f95cf6819883027bd44fed9348 Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Tue, 30 Apr 2024 10:33:01 +0530 Subject: [PATCH 10/13] Fixed: Copywrite years in the footer incase the admin does not provide the website launch year --- .../hotelreservationsystem/views/templates/hook/copyRight.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/hotelreservationsystem/views/templates/hook/copyRight.tpl b/modules/hotelreservationsystem/views/templates/hook/copyRight.tpl index f8e052770..3c4850362 100644 --- a/modules/hotelreservationsystem/views/templates/hook/copyRight.tpl +++ b/modules/hotelreservationsystem/views/templates/hook/copyRight.tpl @@ -1,5 +1,5 @@
\ No newline at end of file From c0845f731b07d4f65e9eb1e5cbd6381630356264 Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Mon, 13 May 2024 11:52:52 +0530 Subject: [PATCH 11/13] Fixed: cart rule does not show under available coupons when cart rule is created from refund request --- .../controllers/admin/AdminOrderRefundRequestsController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/hotelreservationsystem/controllers/admin/AdminOrderRefundRequestsController.php b/modules/hotelreservationsystem/controllers/admin/AdminOrderRefundRequestsController.php index f6eb2fb5f..fa74ab46a 100644 --- a/modules/hotelreservationsystem/controllers/admin/AdminOrderRefundRequestsController.php +++ b/modules/hotelreservationsystem/controllers/admin/AdminOrderRefundRequestsController.php @@ -493,7 +493,7 @@ class AdminOrderRefundRequestsController extends ModuleAdminController $cartrule->date_from = date('Y-m-d H:i:s', $now); $cartrule->date_to = date('Y-m-d H:i:s', $now + (3600 * 24 * 365.25)); /* 1 year */ $cartrule->active = 1; - + $cartrule->highlight = 1; $cartrule->reduction_amount = $totalRefundedAmount; $cartrule->reduction_tax = true; $cartrule->minimum_amount_currency = $objOrder->id_currency; From 218692f2fbc009944c834a362bbfd9499992a165 Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Mon, 13 May 2024 18:02:46 +0530 Subject: [PATCH 12/13] Fixed: The object creation process for the HotelAdvancedPayment --- controllers/admin/AdminProductsController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/controllers/admin/AdminProductsController.php b/controllers/admin/AdminProductsController.php index 6988d73bd..7123dbbf4 100644 --- a/controllers/admin/AdminProductsController.php +++ b/controllers/admin/AdminProductsController.php @@ -1094,9 +1094,9 @@ class AdminProductsControllerCore extends AdminController $obj_adv_pmt = new HotelAdvancedPayment($id_adv_pmt); } else { $obj_adv_pmt = new HotelAdvancedPayment(); - if ($id_adv_pmt = $obj_adv_pmt->getIdAdvPaymentByIdProduct($id_product)) { + if ($adv_pmt_info = $obj_adv_pmt->getIdAdvPaymentByIdProduct($id_product)) { // To prevent duplication from two separate tabs - $obj_adv_pmt = new HotelAdvancedPayment($id_adv_pmt); + $obj_adv_pmt = new HotelAdvancedPayment((int) $adv_pmt_info['id']); } } From e74a1cceb2cbd9c3740e380edda013746c444ff4 Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Mon, 13 May 2024 18:07:42 +0530 Subject: [PATCH 13/13] Fixed: Empty space in the footer if the admin does not provides website launch year --- .../hotelreservationsystem/views/templates/hook/copyRight.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/hotelreservationsystem/views/templates/hook/copyRight.tpl b/modules/hotelreservationsystem/views/templates/hook/copyRight.tpl index 3c4850362..790a4a52c 100644 --- a/modules/hotelreservationsystem/views/templates/hook/copyRight.tpl +++ b/modules/hotelreservationsystem/views/templates/hook/copyRight.tpl @@ -1,5 +1,5 @@
\ No newline at end of file