Skip to content

Commit

Permalink
Merge pull request #277 from sumitwebkul/gli-665
Browse files Browse the repository at this point in the history
Order wise advance payment saved on the orders table in case of the different hotel in the single cart
  • Loading branch information
rohit053 authored Jan 31, 2022
2 parents 6da951d + 34aa95c commit e9cfdb2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion classes/PaymentModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,11 @@ public function validateOrder($id_cart, $id_order_state, $amount_paid, $payment_

// advance payment information
$order->is_advance_payment = $this->context->cart->is_advance_payment;
$order->advance_paid_amount = $cart_total_paid;
if ($order->is_advance_payment) {
$order->advance_paid_amount = (float)Tools::ps_round((float)$this->context->cart->getOrderTotal(true, Cart::ADVANCE_PAYMENT, $order->product_list, $id_carrier), _PS_PRICE_COMPUTE_PRECISION_);
} else {
$order->advance_paid_amount = (float)Tools::ps_round((float)$this->context->cart->getOrderTotal(true, Cart::BOTH, $order->product_list, $id_carrier), _PS_PRICE_COMPUTE_PRECISION_);
}

// Creating order
$result = $order->add();
Expand Down

0 comments on commit e9cfdb2

Please sign in to comment.