From 9ceb34f3d3c1ae09c28bbbddfbc2a65122f35745 Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 7 May 2019 17:47:46 +0200 Subject: [PATCH] Fixed notice when using free shipping --- app/addons/paynl_addon/func.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/app/addons/paynl_addon/func.php b/app/addons/paynl_addon/func.php index ee3fe6c..e9dedff 100644 --- a/app/addons/paynl_addon/func.php +++ b/app/addons/paynl_addon/func.php @@ -251,12 +251,14 @@ function paynl_getTaxForShipping($order_info) foreach ($order_info['shipping'] as $shipping) { $price_incl += $shipping['rate']; $price_excl += $shipping['rate']; - foreach ($shipping['taxes'] as $tax_rule) { - $tax_amount += $tax_rule['tax_subtotal']; - if ($tax_rule['price_includes_tax'] == 'Y') { - $price_excl -= $tax_rule['tax_subtotal']; - } else { - $price_incl += $tax_rule['tax_subtotal']; + if (array_key_exists('taxes', $shipping) && $shipping['taxes'] != false) { + foreach ($shipping['taxes'] as $tax_rule) { + $tax_amount += $tax_rule['tax_subtotal']; + if ($tax_rule['price_includes_tax'] == 'Y') { + $price_excl -= $tax_rule['tax_subtotal']; + } else { + $price_incl += $tax_rule['tax_subtotal']; + } } } }