From 027bdffc499c40c4ac00b1c1e18698958c8b35d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bjo=CC=88rn=20Fromme?= Date: Tue, 31 Jul 2018 15:01:53 +0200 Subject: [PATCH] Treat service prices as floats --- .../ext/ep_products/Classes/Service/ImportService.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/web/typo3conf/ext/ep_products/Classes/Service/ImportService.php b/web/typo3conf/ext/ep_products/Classes/Service/ImportService.php index c5328fc0..3089a338 100644 --- a/web/typo3conf/ext/ep_products/Classes/Service/ImportService.php +++ b/web/typo3conf/ext/ep_products/Classes/Service/ImportService.php @@ -586,9 +586,9 @@ class ImportService implements SingletonInterface $type = 'VER'; } - $price = (int) $service->preis; + $price = (float) str_replace(',', '.', $service->preis); - if ($skipWithoutPrice && $price === 0) { + if ($skipWithoutPrice && $price === 0.0) { continue; } @@ -605,7 +605,7 @@ class ImportService implements SingletonInterface $data[$type][] = [ 'label' => $label, - 'price' => $price, + 'price' => number_format($price, 2, ',', '.'), ]; }