From 615c13431a1e7d6f8dc405c05b9b9d99e341ec6e Mon Sep 17 00:00:00 2001 From: Christian Dangl Date: Mon, 23 Oct 2023 13:40:27 +0200 Subject: [PATCH] MOL-1235: Fix voucher recognition in bundles --- src/Service/Cart/Voucher/VoucherCartCollector.php | 2 +- src/Service/MollieApi/OrderDataExtractor.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Service/Cart/Voucher/VoucherCartCollector.php b/src/Service/Cart/Voucher/VoucherCartCollector.php index ddba643dc..2d7819a43 100644 --- a/src/Service/Cart/Voucher/VoucherCartCollector.php +++ b/src/Service/Cart/Voucher/VoucherCartCollector.php @@ -72,7 +72,7 @@ public function collect(CartDataCollection $data, Cart $original, SalesChannelCo $cartHasVoucher = false; if ($salesChannelHasVoucherMethod) { - foreach ($original->getLineItems() as $item) { + foreach ($original->getLineItems()->getFlat() as $item) { # get the final inherited voucher type of the product # this might even be from the parent $voucherType = $this->voucherService->getFinalVoucherType($item, $context); diff --git a/src/Service/MollieApi/OrderDataExtractor.php b/src/Service/MollieApi/OrderDataExtractor.php index 9d468f896..edf53f225 100644 --- a/src/Service/MollieApi/OrderDataExtractor.php +++ b/src/Service/MollieApi/OrderDataExtractor.php @@ -154,4 +154,5 @@ public function extractLineItems(OrderEntity $orderEntity, Context $context): Or return $lineItems; } + }