From a316307c2ea1c6d7250f75b2db5ec6f0ea6e2bd4 Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Wed, 17 Apr 2024 16:00:52 +0530 Subject: [PATCH 1/7] 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 417d863ea54364afc9fdd17affc824e053af645c Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Fri, 19 Apr 2024 11:39:04 +0530 Subject: [PATCH 2/7] Fixed: Invalid customer voucher amount when changing currency --- themes/hotel-reservation-theme/discount.tpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/themes/hotel-reservation-theme/discount.tpl b/themes/hotel-reservation-theme/discount.tpl index ea4ba715f..b011b1ec2 100644 --- a/themes/hotel-reservation-theme/discount.tpl +++ b/themes/hotel-reservation-theme/discount.tpl @@ -53,7 +53,7 @@ {/if} {if $discountDetail.reduction_amount > 0} {if $discountDetail.reduction_percent > 0} + {/if} - {convertPrice price=$discountDetail.reduction_amount} ({if $discountDetail.reduction_tax == 1}{l s='Tax included'}{else}{l s='Tax excluded'}{/if}) + {displayPrice price=$discountDetail.reduction_amount currency=$discountDetail.reduction_currency} ({if $discountDetail.reduction_tax == 1}{l s='Tax included'}{else}{l s='Tax excluded'}{/if}) {/if} {if $discountDetail.free_shipping} {if $discountDetail.reduction_percent > 0 || $discountDetail.reduction_amount > 0} + {/if} @@ -73,7 +73,7 @@ {if $discountDetail.minimal == 0} {l s='None'} {else} - {convertPrice price=$discountDetail.minimal} ({if $discountDetail.minimum_amount_tax == 1}{l s='Tax included'}{else}{l s='Tax excluded'}{/if}) + {displayPrice price=$discountDetail.minimal currency=$discountDetail.reduction_currency} ({if $discountDetail.minimum_amount_tax == 1}{l s='Tax included'}{else}{l s='Tax excluded'}{/if}) {/if} From b2e3973e8ae01d5cee4b570819e958c0b719ccf5 Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Fri, 19 Apr 2024 12:30:44 +0530 Subject: [PATCH 3/7] Fixed: Auto generated advance price rule are visible in room type configuration --- .../classes/HotelRoomTypeFeaturePricing.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/hotelreservationsystem/classes/HotelRoomTypeFeaturePricing.php b/modules/hotelreservationsystem/classes/HotelRoomTypeFeaturePricing.php index f4be56fd3..5dbfbd1db 100644 --- a/modules/hotelreservationsystem/classes/HotelRoomTypeFeaturePricing.php +++ b/modules/hotelreservationsystem/classes/HotelRoomTypeFeaturePricing.php @@ -794,14 +794,14 @@ class HotelRoomTypeFeaturePricing extends ObjectModel * @param [int] $id_product [id of the product] * @return [array] [returns all feature prices by product] */ - public function getFeaturePricesbyIdProduct($id_product) + public function getFeaturePricesbyIdProduct($id_product, $id_cart = 0, $id_guest = 0, $id_room = 0) { $idLang = Context::getContext()->language->id; return Db::getInstance()->executeS( 'SELECT hrfp.*, hrfpl.`feature_price_name` FROM `'._DB_PREFIX_.'htl_room_type_feature_pricing` hrfp LEFT JOIN `'._DB_PREFIX_.'htl_room_type_feature_pricing_lang` hrfpl ON(hrfp.`id_feature_price` = hrfpl.`id_feature_price` AND hrfpl.`id_lang` = '.(int)$idLang.') - WHERE `id_product` = '.(int)$id_product + WHERE `id_product` = '.(int)$id_product.' AND `id_cart` = '.(int)$id_cart.' AND `id_guest` = '.(int)$id_guest.' AND `id_room` = '.(int)$id_room ); } From 77f68d4b7b4ee752e11e13f5f65bfc6109437858 Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Mon, 22 Apr 2024 13:10:58 +0530 Subject: [PATCH 4/7] 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 5/7] 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 6/7] 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 c0845f731b07d4f65e9eb1e5cbd6381630356264 Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Mon, 13 May 2024 11:52:52 +0530 Subject: [PATCH 7/7] 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;