Skip to content

Commit

Permalink
Fixed notice when using free shipping
Browse files Browse the repository at this point in the history
  • Loading branch information
andy committed May 7, 2019
1 parent 4c833c5 commit 9ceb34f
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions app/addons/paynl_addon/func.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
}
}
}
}
Expand Down

0 comments on commit 9ceb34f

Please sign in to comment.