From 80b74dbb0c6bc062e14e3732e68a50ee90107108 Mon Sep 17 00:00:00 2001 From: dnd-rodrigue Date: Tue, 21 May 2019 14:18:51 +0200 Subject: [PATCH] product-currency: Add verification of product attribute --- app/code/community/Pimgento/Api/Helper/Product.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/code/community/Pimgento/Api/Helper/Product.php b/app/code/community/Pimgento/Api/Helper/Product.php index 35a41e9..4c26e80 100755 --- a/app/code/community/Pimgento/Api/Helper/Product.php +++ b/app/code/community/Pimgento/Api/Helper/Product.php @@ -149,6 +149,9 @@ private function formatValues(stdClass $columns, array $values) // Attribute is a price /** @var mixed[] $price */ foreach ($specifics['data'] as $price) { + if (!array_key_exists('currency', $price) || !array_key_exists('amount', $price)) { + continue; + } /** @var string $priceKey */ $priceKey = sprintf('%s-%s', $key, $price['currency']); $columns->{$priceKey} = $price['amount'];