From c70f4e5dec46acfbc729877bc0aaa80c89cbdcb8 Mon Sep 17 00:00:00 2001 From: Andy Pieters Date: Tue, 2 May 2017 12:32:17 +0200 Subject: [PATCH] Remove shipping cost if shipping is free --- Model/Paymentmethod/PaymentMethod.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Model/Paymentmethod/PaymentMethod.php b/Model/Paymentmethod/PaymentMethod.php index 5a75b722..6bc31afb 100644 --- a/Model/Paymentmethod/PaymentMethod.php +++ b/Model/Paymentmethod/PaymentMethod.php @@ -166,13 +166,15 @@ protected function doStartTransaction(Order $order, UrlInterface $url) $shippingTax = $order->getShippingTaxAmount(); $shippingDescription = $order->getShippingDescription(); - $arrProducts[] = array( - 'id' => 'shipping', - 'name' => $shippingDescription, - 'price' => $shippingCost, - 'qty' => 1, - 'tax' => $shippingTax - ); + if($shippingCost != 0) { + $arrProducts[] = array( + 'id' => 'shipping', + 'name' => $shippingDescription, + 'price' => $shippingCost, + 'qty' => 1, + 'tax' => $shippingTax + ); + } // kortingen $discount = $order->getDiscountAmount();