Skip to content

Commit

Permalink
PISHPS-386: add customized options with price to oder (#886)
Browse files Browse the repository at this point in the history
* NTR: PISHPS-382: add customized options with price to oder

* NTR: cs fix

---------

Co-authored-by: Vitalij Mik <vitalij.mik@dasistweb.de>
  • Loading branch information
BlackScorp and Vitalij Mik authored Nov 6, 2024
1 parent 694f2ef commit 54555e8
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/Service/MollieApi/Builder/MollieLineItemBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,21 @@ public function buildLineItems(string $taxStatus, ?OrderLineItemCollection $line
return $lines;
}

$customizedProducts = $lineItems->filterByType(self::LINE_ITEM_TYPE_CUSTOM_PRODUCTS);

foreach ($customizedProducts as $customizedProduct) {
$productChildren = $customizedProduct->getChildren();
if ($productChildren === null) {
continue;
}
$productChildren = $productChildren->filterByType(self::LINE_ITEM_TYPE_CUSTOM_PRODUCTS_OPTIONS);
foreach ($productChildren as $productChild) {
if ($productChild->getPrice() !== null && $productChild->getPrice()->getTotalPrice() > 0) {
$lineItems->add($productChild);
}
}
}


foreach ($lineItems as $item) {

Expand Down

0 comments on commit 54555e8

Please sign in to comment.