Fixed: Correct room price calculation when adding a new room to an existing order

Co-authored-by: Name <azharbhat.qlo098@webkul.in>
This commit is contained in:
amit sharma
2026-10-13 12:52:15 +05:30
parent 1ebdde4508
commit e6caffe0db

View File

@@ -5172,20 +5172,9 @@ class AdminOrdersControllerCore extends AdminController
$use_taxes = true;
$this->context->currency = new Currency($order->id_currency);
$initial_product_price_tax_incl = Product::getPriceStatic(
$product->id,
$use_taxes,
isset($combination) ? $combination->id : null,
2,
null,
false,
true,
1,
false,
$order->id_customer,
$cart->id,
$order->id_address_tax
);
// price for the selected dates (advance price rules are applied), same as shown in the modal
$roomTotalPrice = HotelRoomTypeFeaturePricing::getRoomTypeTotalPrice($product->id, $date_from, $date_to, 0, Group::getCurrent()->id, 0, 0, 0, 0, 1);
$initial_product_price_tax_incl = Tools::ps_round($roomTotalPrice['total_price_tax_incl'] / $num_days, _PS_PRICE_COMPUTE_PRECISION_);
// create feature price if needed
$createFeaturePrice = $product_informations['product_price_tax_incl'] != $initial_product_price_tax_incl;