Skip to content

Commit

Permalink
changes in calculating advance_paid_amount in orders table
Browse files Browse the repository at this point in the history
  • Loading branch information
sumitwebkul committed Dec 24, 2021
1 parent 2a34e41 commit 34aa95c
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 = (float)Tools::ps_round((float)$this->context->cart->getOrderTotal(true, Cart::ADVANCE_PAYMENT, $order->product_list, $id_carrier), _PS_PRICE_COMPUTE_PRECISION_);
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 34aa95c

Please sign in to comment.