From 1dd6f67643f53bf171c4ab58bdbd46dc3d4251ba Mon Sep 17 00:00:00 2001 From: woutse Date: Thu, 2 Mar 2023 11:33:31 +0100 Subject: [PATCH] Fixed error which occured on zero-priced products --- app/addons/paynl_addon/addon.xml | 2 +- app/addons/paynl_addon/func.php | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/app/addons/paynl_addon/addon.xml b/app/addons/paynl_addon/addon.xml index ecaeadc..a21ee46 100644 --- a/app/addons/paynl_addon/addon.xml +++ b/app/addons/paynl_addon/addon.xml @@ -3,7 +3,7 @@ paynl_addon PAY. PAY. Gateway addon - 1.1.8 + 1.1.9 1000 diff --git a/app/addons/paynl_addon/func.php b/app/addons/paynl_addon/func.php index e498d7a..d9f05fc 100644 --- a/app/addons/paynl_addon/func.php +++ b/app/addons/paynl_addon/func.php @@ -45,7 +45,7 @@ function getObjectData() { $phpVersion = substr(phpversion(), 0, 3); $cscartVersion = defined('PRODUCT_VERSION') ? PRODUCT_VERSION : '-'; - $payPlugin = '1.1.8'; + $payPlugin = '1.1.9'; return substr('cscart ' . $payPlugin . ' | ' . $cscartVersion . ' | ' . $phpVersion, 0, 64); } @@ -97,9 +97,7 @@ function fn_paynl_startTransaction($order_id, $order_info, $processor_data, $exc foreach ($order_info['products'] as $key => $product) { $prices = paynl_getTaxForItem($order_info, $key); - - $taxPercent = $prices['tax_amount'] / $prices['price_excl'] * 100; - + $taxPercent = empty($prices['price_excl']) ? 0 : ($prices['tax_amount'] / $prices['price_excl'] * 100); $taxClass = paynl_getTaxClass($taxPercent); $payNL->addProduct(