]> _ Git - pmi.git/commitdiff
#2810
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 17 Jun 2019 11:47:04 +0000 (13:47 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 17 Jun 2019 11:47:04 +0000 (13:47 +0200)
app/Models/Product.php

index 73b3adc81540f30e0135dfa57e79a517e9f81184..af9da9bcccd2805068304c134bde3f28daf4ceea 100644 (file)
@@ -168,11 +168,16 @@ class Product extends CubistMagicModel
                 $params['type'] = 'SelectFromArray';
                 $options = [];
                 if (is_string($spec->options)) {
-                    $decoded = json_decode($spec->options);
+                    $decoded = [];
+                    if ($spec->options) {
+                        $decoded = json_decode($spec->options);
+                    }
+                } else {
+                    $decoded = $spec->options;
                 }
                 if (is_array($decoded)) {
                     foreach ($decoded as $option) {
-                        $options[] = $option->name;
+                        $options[] = $option->fr;
                     }
 
                 }