]> _ Git - pmi.git/commitdiff
wip #3030 @0.25
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 11 Sep 2019 11:54:07 +0000 (13:54 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 11 Sep 2019 11:54:07 +0000 (13:54 +0200)
app/Models/Product.php

index aec395c0c50fa57aa4fe13b243571eef0ab13a19..db10a99949579e1f2593851e878d4b80c65e4558 100644 (file)
@@ -281,6 +281,9 @@ class Product extends CubistMagicPageModel
                 if ($specEntity->type == 'numeric_list' && is_array($val)) {
                     $specValue .= ' ' . implode(' ' . $specEntity->separator . ' ', $val);
                 } else {
+                    if (is_array($val)) {
+                        $val = array_unshift($val);
+                    }
                     $specValue = $val;
                 }
                 $specValue .= ' ' . $specEntity->unit;
@@ -292,6 +295,9 @@ class Product extends CubistMagicPageModel
                 }
                 $specValue = $val['first'] . ' ' . __('à') . ' ' . $val['second'] . ' ' . $specEntity->unit;
             } else if ($specEntity->type == 'list') {
+                if (is_array($val)) {
+                    continue;
+                }
                 $option = Json::decodeRecursive($specEntity->options, Json::TYPE_ARRAY)[$val];
 
                 $locale = App::getLocale();