From 2c993bb212f86e43205709ebb8b668437dea9874 Mon Sep 17 00:00:00 2001 From: amit sharma Date: Wed, 16 Sep 2026 17:32:29 +0530 Subject: [PATCH] Fixed: Fix service product price calculation in Order and Cart controllers --- .../template/controllers/orders/form.tpl | 8 ++++ .../controllers/orders/helpers/view/view.tpl | 1 + .../_add_order_extra_services_tab_content.tpl | 47 ++++++++++++------- ..._services_service_products_tab_content.tpl | 47 ++++++++++++------- controllers/admin/AdminCartsController.php | 9 ++-- controllers/admin/AdminOrdersController.php | 9 ++-- js/admin/orders.js | 8 ++++ 7 files changed, 87 insertions(+), 42 deletions(-) diff --git a/admin/themes/default/template/controllers/orders/form.tpl b/admin/themes/default/template/controllers/orders/form.tpl index f0d4fe766..dcbcf7b02 100644 --- a/admin/themes/default/template/controllers/orders/form.tpl +++ b/admin/themes/default/template/controllers/orders/form.tpl @@ -35,6 +35,7 @@ var can_edit_booking_carts = {if isset($can_edit_booking_carts) && $can_edit_booking_carts}true{else}false{/if}; var can_add_addresses = {if isset($can_add_addresses) && $can_add_addresses}true{else}false{/if}; var admin_order_tab_link = "{$link->getAdminLink('AdminOrders')|addslashes}"; + var new_service_pcm_once_for_booking = {Product::PRICE_CALCULATION_METHOD_ONCE_FOR_BOOKING|intval}; var changed_shipping_price = false; var shipping_price_selected_carrier = ''; var current_index = '{$current|escape:'html':'UTF-8'}&token={$token|escape:'html':'UTF-8'}'; @@ -53,6 +54,13 @@ var priceDisplayPrecision = {$smarty.const._PS_PRICE_DISPLAY_PRECISION_|intval}; $(document).ready(function() { + $(document).on('change', '#add_new_room_services_form select[name="price_calculation_type"]', function() { + if ($(this).val() == new_service_pcm_once_for_booking) { + $('#new_service_pcm_days_container').hide(); + } else { + $('#new_service_pcm_days_container').show(); + } + }); $('.total_taxes_price_info img').tooltip({ content: function () { diff --git a/admin/themes/default/template/controllers/orders/helpers/view/view.tpl b/admin/themes/default/template/controllers/orders/helpers/view/view.tpl index e409deff6..1dbb62246 100644 --- a/admin/themes/default/template/controllers/orders/helpers/view/view.tpl +++ b/admin/themes/default/template/controllers/orders/helpers/view/view.tpl @@ -44,6 +44,7 @@