Skip to content

Commit

Permalink
fix calculate rabatt
Browse files Browse the repository at this point in the history
  • Loading branch information
mariolorenz committed Sep 29, 2023
1 parent ed66149 commit b086bc0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/Core/OrderRequestFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,9 @@ protected function getAmount(): AmountWithBreakdown
$itemTotal += $discount;
$discount = 0;
}
$total = $itemTotal - $discount;

$total = PriceToMoney::convert($itemTotal, $currency);
$total = PriceToMoney::convert($total, $currency);

//Total amount
$amount = new AmountWithBreakdown();
Expand Down
2 changes: 1 addition & 1 deletion src/Model/Basket.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public function getPayPalCheckoutDiscount(): float
// vouchers..
$vouchers = (array) $this->getVouchers();
foreach ($vouchers as $voucher) {
$discount -= round($voucher->dVoucherdiscount, 2);
$discount += round($voucher->dVoucherdiscount, 2);
}

return $discount;
Expand Down

0 comments on commit b086bc0

Please sign in to comment.