If you like to change the order total amount, to add an extra fee or something else after choosing a payment method by the client.
You can do it by overriding the validateOrder method, in classes/PaymentModule.php,
and change it like this, for prestashop 1.6.0.13, change the instruction in line 13 by
In this example, i added a 25% extra fee to order total amount when the payment method is bankwire. Hope this helps.
if($payment_method == 'Bank wire') $order->total_paid_tax_incl = (float)Tools::ps_round((float)$this->context->cart->getOrderTotal(true, Cart::BOTH, $order->product_list, $id_carrier)*1.25, 2);
In this example, i added a 25% extra fee to order total amount when the payment method is bankwire. Hope this helps.
0 commentaires :
Enregistrer un commentaire