Skip to content

Commit 9699021

Browse files
committed
Remove adjustments recursively from the order
1 parent c1b4be0 commit 9699021

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/Applicator/OrderEuropeanVATNumberApplicator.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
use Sylius\Component\Core\Model\ChannelInterface;
1717
use Sylius\Component\Core\Model\OrderInterface;
1818
use Sylius\Component\Core\Taxation\Applicator\OrderTaxesApplicatorInterface;
19-
use Webmozart\Assert\Assert;
2019

2120
final class OrderEuropeanVATNumberApplicator implements OrderTaxesApplicatorInterface
2221
{
@@ -57,12 +56,7 @@ public function apply(OrderInterface $order, ZoneInterface $zone): void
5756
return;
5857
}
5958

60-
foreach ($order->getItems() as $item) {
61-
$quantity = $item->getQuantity();
62-
Assert::notSame($quantity, 0, 'Cannot apply tax to order item with 0 quantity.');
63-
64-
$item->removeAdjustmentsRecursively(AdjustmentInterface::TAX_ADJUSTMENT);
65-
}
59+
$order->removeAdjustmentsRecursively(AdjustmentInterface::TAX_ADJUSTMENT);
6660
}
6761

6862
private function isValidForZeroEuropeanVAT(

0 commit comments

Comments
 (0)