Skip to content

Commit

Permalink
Merge pull request #10 from azngeek/main
Browse files Browse the repository at this point in the history
Additional Check, if Line-Item is set
  • Loading branch information
ChristopherDosin authored Feb 10, 2023
2 parents e34f74f + d7b2acb commit 63e5d5d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG_de-DE.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG_en-GB.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
8 changes: 5 additions & 3 deletions src/Subscriber/CartPageLoadedSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}
}
}
Expand Down

0 comments on commit 63e5d5d

Please sign in to comment.