From d8fd51d270c6d84df42dbd0512ae2d11b96bc8c3 Mon Sep 17 00:00:00 2001 From: Don Bosco van Hoi Date: Wed, 8 Feb 2023 16:00:22 +0100 Subject: [PATCH 1/2] Additional Check, if Line-Item is set --- src/Subscriber/CartPageLoadedSubscriber.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Subscriber/CartPageLoadedSubscriber.php b/src/Subscriber/CartPageLoadedSubscriber.php index 465d8aa..381d66b 100644 --- a/src/Subscriber/CartPageLoadedSubscriber.php +++ b/src/Subscriber/CartPageLoadedSubscriber.php @@ -121,9 +121,11 @@ private function addLineItemPropertyGroups(LineItemCollection $lineItems, SalesC if ($product->getExtension('groups') !== null) { $lineItem = $lineItems->get($product->getId()); - $lineItem->addExtension('groups', $product->getExtension('groups')); - $lineItem->setPayloadValue('parentId', $product->getParentId()); - $lineItem->setPayloadValue('optionIds', $product->getOptionIds()); + if (null !== $lineItem) { + $lineItem->addExtension('groups', $product->getExtension('groups')); + $lineItem->setPayloadValue('parentId', $product->getParentId()); + $lineItem->setPayloadValue('optionIds', $product->getOptionIds()); + } } } } From d7b2acbbdbf8c6b176c19767aadfaf31bfaefb5f Mon Sep 17 00:00:00 2001 From: Don Bosco van Hoi Date: Fri, 10 Feb 2023 09:31:12 +0100 Subject: [PATCH 2/2] Changelog und composer aktualisiert --- CHANGELOG_de-DE.md | 4 ++++ CHANGELOG_en-GB.md | 4 ++++ composer.json | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG_de-DE.md b/CHANGELOG_de-DE.md index d457e06..f3af989 100644 --- a/CHANGELOG_de-DE.md +++ b/CHANGELOG_de-DE.md @@ -1,3 +1,7 @@ +# 1.1.1 - Bugfix + +- [Issue #9](https://github.com/Shape-and-Shift/shopware-variant-switch/issues/9)] Positionen ohne valide Line-Items werden übersprungen + # 1.1.0 - Erweiterung - [Issue #1](https://github.com/Shape-and-Shift/shopware-variant-switch/issues/1) Zeige auch Varianten, die nicht auf Lager sind - [Issue #2](https://github.com/Shape-and-Shift/shopware-variant-switch/issues/2) Ausblenden von geteilten Varianten diff --git a/CHANGELOG_en-GB.md b/CHANGELOG_en-GB.md index a585a17..6a7c111 100644 --- a/CHANGELOG_en-GB.md +++ b/CHANGELOG_en-GB.md @@ -1,3 +1,7 @@ +# 1.1.1 - Bugfix + +- [Issue #9](https://github.com/Shape-and-Shift/shopware-variant-switch/issues/9)] Carts-items without valid line items will be skipped + # 1.1.0 - Enhancement - [Issue #1](https://github.com/Shape-and-Shift/shopware-variant-switch/issues/1) Show also variants which are out of stock - [Issue #2](https://github.com/Shape-and-Shift/shopware-variant-switch/issues/2) Hide split variants diff --git a/composer.json b/composer.json index 98b2f21..3c708d1 100644 --- a/composer.json +++ b/composer.json @@ -3,7 +3,7 @@ "description":"Show a variant switch within the listing and cart", "type":"shopware-platform-plugin", "license":"MIT", - "version":"1.1.0", + "version":"1.1.1", "keywords":[ "variant", "shopware"