From 1bfa256d1e20071e47328c05862f9398d4e52f17 Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Mon, 13 Mar 2023 11:13:20 +0530 Subject: [PATCH] show service cost seprate from room cost --- .../classes/HotelCartBookingData.php | 28 +++++++++++++++++++ .../hotel-reservation-theme/shopping-cart.tpl | 8 +++++- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/modules/hotelreservationsystem/classes/HotelCartBookingData.php b/modules/hotelreservationsystem/classes/HotelCartBookingData.php index 3afd75fac..15fc9489b 100644 --- a/modules/hotelreservationsystem/classes/HotelCartBookingData.php +++ b/modules/hotelreservationsystem/classes/HotelCartBookingData.php @@ -1331,12 +1331,26 @@ class HotelCartBookingData extends ObjectModel $data_v['date_from'], $data_v['date_to'] ); + $roomTypeDateRangePriceWithoutAutoAdd = HotelRoomTypeFeaturePricing::getRoomTypeTotalPrice( + $product['id_product'], + $data_v['date_from'], + $data_v['date_to'], + 0, + 0, + 0, + 0, + 0, + 0 + ); if (!$price_tax) { $amount = $roomTypeDateRangePrice['total_price_tax_excl']; + $amountWithoutAutoAdd = $roomTypeDateRangePriceWithoutAutoAdd['total_price_tax_excl']; } else { $amount = $roomTypeDateRangePrice['total_price_tax_incl']; + $amountWithoutAutoAdd = $roomTypeDateRangePriceWithoutAutoAdd['total_price_tax_incl']; } $cartHotelData[$prodKey]['date_diff'][$dateJoin]['amount'] = $amount * $varQty; + $cartHotelData[$prodKey]['date_diff'][$dateJoin]['amount_without_auto_add'] = $amountWithoutAutoAdd * $varQty; } else { $cartHotelData[$prodKey]['date_diff'][$dateJoin]['demand_price'] = $totalAdditionalServicePrice; $numDays = $objBookingDetail->getNumberOfDays($data_v['date_from'], $data_v['date_to']); @@ -1359,12 +1373,26 @@ class HotelCartBookingData extends ObjectModel $data_v['date_from'], $data_v['date_to'] ); + $roomTypeDateRangePriceWithoutAutoAdd = HotelRoomTypeFeaturePricing::getRoomTypeTotalPrice( + $product['id_product'], + $data_v['date_from'], + $data_v['date_to'], + 0, + 0, + 0, + 0, + 0, + 0 + ); if (!$price_tax) { $amount = $roomTypeDateRangePrice['total_price_tax_excl']; + $amountWithoutAutoAdd = $roomTypeDateRangePriceWithoutAutoAdd['total_price_tax_excl']; } else { $amount = $roomTypeDateRangePrice['total_price_tax_incl']; + $amountWithoutAutoAdd = $roomTypeDateRangePriceWithoutAutoAdd['total_price_tax_incl']; } $cartHotelData[$prodKey]['date_diff'][$dateJoin]['amount'] = $amount; + $cartHotelData[$prodKey]['date_diff'][$dateJoin]['amount_without_auto_add'] = $amountWithoutAutoAdd; $cartHotelData[$prodKey]['date_diff'][$dateJoin]['link'] = $context->link->getPageLink( 'order-opc', null, diff --git a/themes/hotel-reservation-theme/shopping-cart.tpl b/themes/hotel-reservation-theme/shopping-cart.tpl index 4c04053b5..48867d4b6 100644 --- a/themes/hotel-reservation-theme/shopping-cart.tpl +++ b/themes/hotel-reservation-theme/shopping-cart.tpl @@ -148,8 +148,14 @@

- {displayPrice price=($rm_v['amount'])} + {displayPrice price=($rm_v['amount_without_auto_add'])} +
+ {if ($rm_v['amount'] - $rm_v['amount_without_auto_add']) > 0} + + + {displayPrice price=($rm_v['amount'] - $rm_v['amount_without_auto_add'])} + + {/if} {if (isset($data_v['extra_demands']) && $data_v['extra_demands']) || (isset($data_v['service_products']) && $data_v['service_products'])} +