diff --git a/classes/models/LengowProduct.php b/classes/models/LengowProduct.php index cea3de06..b9691708 100755 --- a/classes/models/LengowProduct.php +++ b/classes/models/LengowProduct.php @@ -831,7 +831,12 @@ public static function extractProductDataFromAPI($api) foreach (self::$productApiNodes as $node) { $temp[$node] = $api->{$node}; } - $temp['price_unit'] = (float) $temp['amount'] / (float) $temp['quantity']; + $qty = (float) $temp['quantity']; + if ($qty <= 0) { + $temp['price_unit'] = 0; + } else { + $temp['price_unit'] = (float) $temp['amount'] / $qty; + } return $temp; }