Skip to content

Commit

Permalink
Set amount to the subtotal when the discount amount exceeds the subtotal
Browse files Browse the repository at this point in the history
  • Loading branch information
jan888adams committed Sep 30, 2024
1 parent 2230833 commit 5ae13a1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/PricingManager/Action/CartDiscount.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function executeOnCart(EnvironmentInterface $environment): ActionInterfac
$amount = Decimal::fromDecimal($amount->withScale(2));
}

$amount = $amount->mul(-1);
$amount = $amount->toAdditiveInverse();

//make sure that one rule is applied only once
foreach ($priceCalculator->getModificators() as &$modificator) {
Expand Down

0 comments on commit 5ae13a1

Please sign in to comment.