From: Vincent Vanwaelscappel Date: Mon, 17 Jun 2019 11:47:04 +0000 (+0200) Subject: #2810 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=1d8d63e50e6466b8f9d6c3061b3f4fce527fbbc8;p=pmi.git #2810 --- diff --git a/app/Models/Product.php b/app/Models/Product.php index 73b3adc..af9da9b 100644 --- a/app/Models/Product.php +++ b/app/Models/Product.php @@ -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; } }