From 5eec321f1cee949c7c12c6bd356231d99e205f70 Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Wed, 23 Apr 2025 16:07:37 +0530 Subject: [PATCH] Fixed: the price stays the same for the booking if admin selects a customer with a group discount and then refreshes the page --- classes/Cart.php | 2 -- controllers/admin/AdminOrdersController.php | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/classes/Cart.php b/classes/Cart.php index 1444a2aad..e826b3f97 100644 --- a/classes/Cart.php +++ b/classes/Cart.php @@ -635,8 +635,6 @@ class CartCore extends ObjectModel return array(); } - $customer = new Customer($this->id_customer); - Context::getContext()->customer = $customer; $cart_shop_context = Context::getContext()->cloneContext(); foreach ($result as &$row) { diff --git a/controllers/admin/AdminOrdersController.php b/controllers/admin/AdminOrdersController.php index 90593bfbc..cad0ddada 100644 --- a/controllers/admin/AdminOrdersController.php +++ b/controllers/admin/AdminOrdersController.php @@ -1680,6 +1680,8 @@ class AdminOrdersControllerCore extends AdminController $this->context->cart = $objCart; $this->context->currency = new Currency((int)$objCart->id_currency); + // Setting the customer in context to get the order total with the group discount. + $this->context->customer = new Customer($objCart->id_customer); $this->errors = HotelCartBookingData::validateCartBookings(); $orderTotal = $objCart->getOrderTotal(true, Cart::BOTH); if ($objCart->is_advance_payment) {