From 1d8d63e50e6466b8f9d6c3061b3f4fce527fbbc8 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Mon, 17 Jun 2019 13:47:04 +0200 Subject: [PATCH] #2810 --- app/Models/Product.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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; } } -- 2.39.5