From: soufiane Date: Mon, 17 Jul 2023 15:57:30 +0000 (+0200) Subject: wait #5858 0:10 fix bug calcul des options X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=0bed794d46689f56978b7a5f4ac59e34c4adef43;p=pmi.git wait #5858 0:10 fix bug calcul des options --- 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; }