From 412f43919b01bbc8ee590f05f3d40ef48ed5c604 Mon Sep 17 00:00:00 2001 From: Amit sharma Date: Fri, 29 May 2026 19:12:37 +0530 Subject: [PATCH] Fix: Incorrect selling type context during order validation for multi-preference service products --- .../normal_products/helpers/form/form.tpl | 6 +- .../normal_products/informations.tpl | 14 ++-- .../controllers/orders/helpers/view/view.tpl | 4 +- classes/Cart.php | 45 +++++------ classes/PaymentModule.php | 22 +++--- classes/Product.php | 36 ++++----- classes/order/Order.php | 4 +- classes/order/OrderInvoice.php | 4 +- classes/pdf/HTMLTemplateInvoice.php | 8 +- classes/pdf/HTMLTemplateOrderSlip.php | 4 +- .../WebserviceSpecificManagementBookings.php | 2 +- config/defines.inc.php | 2 +- .../admin/AdminNormalProductsController.php | 18 ++--- controllers/admin/AdminOrdersController.php | 32 ++++---- controllers/front/GuestTrackingController.php | 4 +- .../front/OrderConfirmationController.php | 8 +- controllers/front/OrderDetailController.php | 4 +- controllers/front/ParentOrderController.php | 14 ++-- js/admin/normal_products.js | 4 +- modules/blockcart/ajax-cart.js | 54 ++++---------- modules/blockcart/blockcart.tpl | 8 +- .../AdminHotelRoomsBookingController.php | 4 +- .../_partials/cart_booking_demands.tpl | 28 ++++++- ...e-calculation-info.tpl => htl-tooltip.tpl} | 24 ++---- .../_partials/order-extra-services.tpl | 28 ++++++- .../_partials/order-room-detail.tpl | 56 +++++++------- .../_partials/service-products-list-row.tpl | 28 ++++++- themes/hotel-reservation-theme/css/global.css | 67 ++++++++++------- themes/hotel-reservation-theme/js/global.js | 67 ++++++++--------- .../js/modules/blockcart/ajax-cart.js | 54 ++++---------- .../js/order-confirmation.js | 41 +--------- .../js/order-detail.js | 74 +------------------ .../hotel-reservation-theme/js/order-opc.js | 41 +--------- themes/hotel-reservation-theme/js/product.js | 2 +- .../modules/blockcart/blockcart.tpl | 8 +- .../order-confirmation.tpl | 56 +++++++------- .../hotel-reservation-theme/order-detail.tpl | 12 +-- .../shopping-cart-detail.tpl | 22 +++--- 38 files changed, 387 insertions(+), 522 deletions(-) rename themes/hotel-reservation-theme/_partials/{price-calculation-info.tpl => htl-tooltip.tpl} (59%) diff --git a/admin/themes/default/template/controllers/normal_products/helpers/form/form.tpl b/admin/themes/default/template/controllers/normal_products/helpers/form/form.tpl index 14b55a338..d1b79abc2 100644 --- a/admin/themes/default/template/controllers/normal_products/helpers/form/form.tpl +++ b/admin/themes/default/template/controllers/normal_products/helpers/form/form.tpl @@ -77,9 +77,9 @@ var product_type_simple = {Product::PTYPE_SIMPLE|intval}; var SELLING_PREFERENCE_WITH_ROOM_TYPE = {Product::SELLING_PREFERENCE_WITH_ROOM_TYPE|intval}; - var SELLING_PREFERENCE_HOTEL_STANDALONE = {Product::SELLING_PREFERENCE_HOTEL_STANDALONE|intval}; - var SELLING_PREFERENCE_WITH_HOTE_AND_WITH_ROOM_TYPE = {Product::SELLING_PREFERENCE_WITH_HOTE_AND_WITH_ROOM_TYPE|intval}; - var SELLING_PREFERENCE_STANDALONE = {Product::SELLING_PREFERENCE_STANDALONE|intval}; + var SELLING_PREFERENCE_WITH_HOTEL = {Product::SELLING_PREFERENCE_WITH_HOTEL|intval}; + var SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE = {Product::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE|intval}; + var SELLING_PREFERENCE_WITH_STANDALONE = {Product::SELLING_PREFERENCE_WITH_STANDALONE|intval}; var price_addition_type_with_room = {Product::PRICE_ADDITION_TYPE_WITH_ROOM|intval}; var price_addition_type_independent = {Product::PRICE_ADDITION_TYPE_INDEPENDENT|intval}; diff --git a/admin/themes/default/template/controllers/normal_products/informations.tpl b/admin/themes/default/template/controllers/normal_products/informations.tpl index 7dcd57e42..3437c1d03 100644 --- a/admin/themes/default/template/controllers/normal_products/informations.tpl +++ b/admin/themes/default/template/controllers/normal_products/informations.tpl @@ -261,7 +261,7 @@ -
selling_preference_type != Product::SELLING_PREFERENCE_HOTEL_STANDALONE && $product->selling_preference_type != Product::SELLING_PREFERENCE_WITH_HOTE_AND_WITH_ROOM_TYPE && $product->selling_preference_type != Product::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_STANDALONE && $product->selling_preference_type != Product::SELLING_PREFERENCE_WITH_HOTE_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE)}style="display:none;"{/if}> +
selling_preference_type != Product::SELLING_PREFERENCE_WITH_HOTEL && $product->selling_preference_type != Product::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE && $product->selling_preference_type != Product::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_STANDALONE && $product->selling_preference_type != Product::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE)}style="display:none;"{/if}>
{include file="controllers/products/multishop/checkbox.tpl" field="category_box" type="category_box"}
-
selling_preference_type != Product::SELLING_PREFERENCE_WITH_ROOM_TYPE && $product->selling_preference_type != Product::SELLING_PREFERENCE_WITH_HOTE_AND_WITH_ROOM_TYPE && $product->selling_preference_type != Product::SELLING_PREFERENCE_WITH_STANDALONE_AND_WITH_ROOM_TYPE && $product->selling_preference_type != Product::SELLING_PREFERENCE_WITH_HOTE_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE && $product->selling_preference_type != 0)}style="display:none;"{/if}> +
selling_preference_type != Product::SELLING_PREFERENCE_WITH_ROOM_TYPE && $product->selling_preference_type != Product::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE && $product->selling_preference_type != Product::SELLING_PREFERENCE_WITH_STANDALONE_AND_WITH_ROOM_TYPE && $product->selling_preference_type != Product::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE && $product->selling_preference_type != 0)}style="display:none;"{/if}>
{include file="controllers/products/multishop/checkbox.tpl" field="category_box" type="category_box"}
-
selling_preference_type != Product::SELLING_PREFERENCE_WITH_ROOM_TYPE && $product->selling_preference_type != Product::SELLING_PREFERENCE_WITH_HOTE_AND_WITH_ROOM_TYPE && $product->selling_preference_type != Product::SELLING_PREFERENCE_WITH_STANDALONE_AND_WITH_ROOM_TYPE && $product->selling_preference_type != Product::SELLING_PREFERENCE_WITH_HOTE_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE && $product->selling_preference_type != 0}style="display:none;"{/if}> +
selling_preference_type != Product::SELLING_PREFERENCE_WITH_ROOM_TYPE && $product->selling_preference_type != Product::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE && $product->selling_preference_type != Product::SELLING_PREFERENCE_WITH_STANDALONE_AND_WITH_ROOM_TYPE && $product->selling_preference_type != Product::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE && $product->selling_preference_type != 0}style="display:none;"{/if}>
{$product['name']|escape:'html':'UTF-8'} - {include file='_partials/price-calculation-info.tpl' pcm=$product.price_calculation_method|default:0} + {assign var='priceCalcMethod' value=$product.price_calculation_method|default:0} + {capture name='htl_pcm_tooltip'} +
+

{l s='Applied on:'}

+
    + {if $priceCalcMethod == Product::PRICE_CALCULATION_METHOD_ON_CHECKIN_DAY + || $priceCalcMethod == Product::PRICE_CALCULATION_METHOD_CHECKIN_DAY_AND_CHECKOUT_DAY + || $priceCalcMethod == Product::PRICE_CALCULATION_METHOD_CHECKIN_AND_DURING_STAY + || $priceCalcMethod == Product::PRICE_CALCULATION_METHOD_CHECKIN_AND_CHECKOUT_AND_DURING_STAY} +
  • {l s='Check-in day'}
  • + {/if} + {if $priceCalcMethod == Product::PRICE_CALCULATION_METHOD_ON_DURING_STAY + || $priceCalcMethod == Product::PRICE_CALCULATION_METHOD_CHECKIN_AND_DURING_STAY + || $priceCalcMethod == Product::PRICE_CALCULATION_METHOD_CHECKOUT_AND_DURING_STAY + || $priceCalcMethod == Product::PRICE_CALCULATION_METHOD_CHECKIN_AND_CHECKOUT_AND_DURING_STAY} +
  • {l s='During-stay days'}
  • + {/if} + {if $priceCalcMethod == Product::PRICE_CALCULATION_METHOD_ON_CHECKOUT_DAY + || $priceCalcMethod == Product::PRICE_CALCULATION_METHOD_CHECKIN_DAY_AND_CHECKOUT_DAY + || $priceCalcMethod == Product::PRICE_CALCULATION_METHOD_CHECKOUT_AND_DURING_STAY + || $priceCalcMethod == Product::PRICE_CALCULATION_METHOD_CHECKIN_AND_CHECKOUT_AND_DURING_STAY} +
  • {l s='Check-out day'}
  • + {/if} +
+
+ {/capture} + {include file='_partials/htl-tooltip.tpl' tooltip_content=$smarty.capture.htl_pcm_tooltip allow_html=true} {if $product.allow_multiple_quantity}
diff --git a/themes/hotel-reservation-theme/_partials/price-calculation-info.tpl b/themes/hotel-reservation-theme/_partials/htl-tooltip.tpl similarity index 59% rename from themes/hotel-reservation-theme/_partials/price-calculation-info.tpl rename to themes/hotel-reservation-theme/_partials/htl-tooltip.tpl index af5f05850..997e93fa7 100644 --- a/themes/hotel-reservation-theme/_partials/price-calculation-info.tpl +++ b/themes/hotel-reservation-theme/_partials/htl-tooltip.tpl @@ -20,24 +20,14 @@ * @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0 *} -{* Required param: pcm — price_calculation_method integer value *} - + -
diff --git a/themes/hotel-reservation-theme/_partials/order-room-detail.tpl b/themes/hotel-reservation-theme/_partials/order-room-detail.tpl index aaf47aa0c..35f3ac7c9 100644 --- a/themes/hotel-reservation-theme/_partials/order-room-detail.tpl +++ b/themes/hotel-reservation-theme/_partials/order-room-detail.tpl @@ -125,41 +125,35 @@ {displayWtPriceWithCurrency price=($rm_v.amount_tax_excl + $rm_v.extra_demands_price_te + $rm_v.additional_services_price_te + $rm_v.additional_services_price_auto_add_te) currency=$currency} {/if} {if (isset($rm_v.extra_demands) && $rm_v.extra_demands) || isset($rm_v.additional_services) && $rm_v.additional_services} - - - -