From fd10852401d265951973456946e28a09e642c4cc Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Sat, 25 Mar 2023 14:41:49 +0530 Subject: [PATCH] added configuration for room price breakdown oncheckout page --- controllers/admin/AdminOrderPreferencesController.php | 8 +++++++- controllers/front/OrderOpcController.php | 1 + themes/hotel-reservation-theme/shopping-cart.tpl | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/controllers/admin/AdminOrderPreferencesController.php b/controllers/admin/AdminOrderPreferencesController.php index e1c53fd2d..b60938251 100644 --- a/controllers/admin/AdminOrderPreferencesController.php +++ b/controllers/admin/AdminOrderPreferencesController.php @@ -151,7 +151,13 @@ class AdminOrderPreferencesControllerCore extends AdminController 'list' => $cms_tab, 'identifier' => 'id', 'cast' => 'intval' - ) + ), + 'PS_AUTO_ADD_SERVICE_BREAKDOWN' => array( + 'title' => $this->l('Show room price breakdown'), + 'desc' => $this->l('Show a summary for prices of the auto added service add with room on shopping cart list.'), + 'cast' => 'intval', + 'type' => 'bool' + ), ), 'submit' => array('title' => $this->l('Save')) ), diff --git a/controllers/front/OrderOpcController.php b/controllers/front/OrderOpcController.php index a08bd1cae..9d8cf3173 100644 --- a/controllers/front/OrderOpcController.php +++ b/controllers/front/OrderOpcController.php @@ -467,6 +467,7 @@ class OrderOpcControllerCore extends ParentOrderController // 'defaultcurrencySign' => $objCurrency->sign, 'THEME_DIR' => _THEME_DIR_, 'PS_CUSTOMER_ADDRESS_CREATION' => Configuration::get('PS_CUSTOMER_ADDRESS_CREATION'), + 'PS_AUTO_ADD_SERVICE_BREAKDOWN' => Configuration::get('PS_AUTO_ADD_SERVICE_BREAKDOWN'), 'free_shipping' => $free_shipping, 'isGuest' => isset($this->context->cookie->is_guest) ? $this->context->cookie->is_guest : 0, 'countries' => $countries, diff --git a/themes/hotel-reservation-theme/shopping-cart.tpl b/themes/hotel-reservation-theme/shopping-cart.tpl index a750fc5b9..1a979f43e 100644 --- a/themes/hotel-reservation-theme/shopping-cart.tpl +++ b/themes/hotel-reservation-theme/shopping-cart.tpl @@ -150,7 +150,7 @@ {displayPrice price=($rm_v['amount'])} - {if (($rm_v['amount'] - $rm_v['amount_without_auto_add']) > 0) && in_array($data_v['id_product'], $discounted_products)} + {if (($rm_v['amount'] - $rm_v['amount_without_auto_add']) > 0) && (in_array($data_v['id_product'], $discounted_products) || $PS_AUTO_ADD_SERVICE_BREAKDOWN)}