From 0bed794d46689f56978b7a5f4ac59e34c4adef43 Mon Sep 17 00:00:00 2001 From: soufiane Date: Mon, 17 Jul 2023 17:57:30 +0200 Subject: [PATCH] wait #5858 0:10 fix bug calcul des options --- app/Models/Product.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Models/Product.php b/app/Models/Product.php index 6f10b22..aa0b545 100644 --- a/app/Models/Product.php +++ b/app/Models/Product.php @@ -554,9 +554,9 @@ class Product extends CubistMagicPageModel } public static function totalOptionPrice($optionPrice, $refs) { - return array_reduce($optionPrice[$refs], function ($carry, $item) { + return $optionPrice ? array_reduce($optionPrice[$refs], function ($carry, $item) { return $carry + $item; - }); + }) : 0; } -- 2.39.5