diff --git a/classes/PaymentModule.php b/classes/PaymentModule.php index c451a8923..1a5517fb4 100644 --- a/classes/PaymentModule.php +++ b/classes/PaymentModule.php @@ -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();