Fixed: the price stays the same for the booking if admin selects a customer with a group discount and then refreshes the page

This commit is contained in:
vishalsingh.qlo325
2025-04-23 16:07:37 +05:30
parent 69a89e8adf
commit 5eec321f1c
2 changed files with 2 additions and 2 deletions

View File

@@ -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) {

View File

@@ -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) {