mirror of
https://github.com/OpenXE-org/OpenXE.git
synced 2024-12-25 14:10:28 +01:00
bugfix: check for divisionByZero
This commit is contained in:
parent
76c770aba3
commit
c6dd3fdeff
@ -284,17 +284,20 @@ class Shopimporter_Presta extends ShopimporterBase
|
||||
|
||||
$cart['articlelist'] = [];
|
||||
foreach ($order->associations->order_rows->order_row as $order_row) {
|
||||
|
||||
$steuersatz = (strval($order_row->unit_price_tax_incl) / strval($order_row->unit_price_tax_excl)) - 1;
|
||||
$steuersatz = round($steuersatz, 1);
|
||||
|
||||
$cart['articlelist'][] = [
|
||||
$article = [
|
||||
'articleid' => strval($order_row->product_reference),
|
||||
'name' => strval($order_row->product_name),
|
||||
'quantity' => strval($order_row->product_quantity),
|
||||
'price_netto' => strval($order_row->unit_price_tax_excl),
|
||||
'steuersatz' => $steuersatz
|
||||
];
|
||||
|
||||
if ($order_row->unit_price_tax_excl > 0) {
|
||||
$steuersatz = (strval($order_row->unit_price_tax_incl) / strval($order_row->unit_price_tax_excl)) - 1;
|
||||
$steuersatz = round($steuersatz, 1);
|
||||
$article['steuersatz'] = $steuersatz;
|
||||
}
|
||||
|
||||
$cart['articlelist'][] = $article;
|
||||
}
|
||||
|
||||
$fetchedOrders[] = [
|
||||
|
Loading…
Reference in New Issue
Block a user