Skip to content

Commit

Permalink
Fixes discount by amount for apply once or apply to all items
Browse files Browse the repository at this point in the history
  • Loading branch information
iainheng committed Aug 6, 2020
1 parent 965bee6 commit 719bf02
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Coupons/MinRequiredItemCoupon.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public function apply(Cart $cart, $throwErrors = true)
foreach ($discountableCartItems as $cartItem) {
$this->applyToCart = false;

$valueAfterDivided = $cartItem->priceTotal / $totalCartItemsAmount * $this->value;
$valueAfterDivided = $cartItem->price / $totalCartItemsAmount * $this->value;

$cartItem->setDiscount($valueAfterDivided, $this->percentageDiscount, $this->applyOnce);

Expand Down

0 comments on commit 719bf02

Please sign in to comment.