From 0cdc1cbd127a963f8aaef0f94e57ef59cb85694d Mon Sep 17 00:00:00 2001 From: Frank Schubert Date: Fri, 20 Sep 2024 13:06:59 +0200 Subject: [PATCH] Fixed price with comma in PreorderApi submitPreorder() --- application/Api/v1/PreorderApicontroller.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/application/Api/v1/PreorderApicontroller.php b/application/Api/v1/PreorderApicontroller.php index afa0f4aa0..02725889e 100644 --- a/application/Api/v1/PreorderApicontroller.php +++ b/application/Api/v1/PreorderApicontroller.php @@ -830,8 +830,14 @@ class PreorderApicontroller extends mfBaseApicontroller { //$preorder_data['price_setup'] = round($product->price_setup - (($product->price_setup) / 100) * TT_PREORDER_DISCOUNT_BUSINESS); $preorder_data['price_setup'] = ($product->attributes["presales_setup_price_business"]->value) ? $product->attributes["presales_setup_price_business"]->value : $product->price_setup; } - + + if($preorder_data['price_setup']) { + $preorder_data['price_setup'] = str_replace(',', '.', $preorder_data['price_setup']); + } } + + + /* * get customer data @@ -1021,6 +1027,8 @@ class PreorderApicontroller extends mfBaseApicontroller { } if(!$preorder_id || !$preorder->ucode) { + $err_id = uniqid('err'); + $this->log->error(__METHOD__.": [$err_id] Error saving Preorder"); if($unit_changed) $unit->rollbackTransaction(); return mfResponse::InternalServerError(); }