Skip to content

Commit

Permalink
NTR: PISHPS-382: add customized options with price to oder
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitalij Mik committed Nov 6, 2024
1 parent 694f2ef commit 58fe0d8
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/Service/MollieApi/Builder/MollieLineItemBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,22 @@ 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 58fe0d8

Please sign in to comment.