From 9fe3d31b3cd237717599fdd67c172d365311dde1 Mon Sep 17 00:00:00 2001 From: Bruno Dias Date: Wed, 10 Feb 2021 18:16:47 +0000 Subject: [PATCH] Fix error on null variable (#3) --- Helper/Data.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Helper/Data.php b/Helper/Data.php index 8fb5838..a0b291e 100644 --- a/Helper/Data.php +++ b/Helper/Data.php @@ -30,7 +30,9 @@ public function getOptions($currentProduct, $allowedProducts, $stockdata = null) $options['index'][$productId][$productAttributeId] = $attributeValue; } //Adding stock status in the option list. - $options['stock'][$productId][] = $stockdata[$productId]['out_stock']; + if (isset($stockdata)) { + $options['stock'][$productId][] = $stockdata[$productId]['out_stock']; + } } return $options; }