Edge case fix for Cart Rule actions
This commit is contained in:
parent
c9cd73b67e
commit
6ca065544c
|
|
@ -58,9 +58,7 @@ class FixedAmount extends Action
|
|||
|
||||
$discount = round($itemPrice * $discQuantity, 4) * $discQuantity;
|
||||
|
||||
if ($rule->action_type == 'fixed_amount') {
|
||||
$discount = $discount <= $itemPrice ? $discount : $itemPrice;
|
||||
}
|
||||
$discount = $discount <= $itemPrice * $discQuantity ? $discount : $itemPrice * $discQuantity;
|
||||
|
||||
$report['discount'] = $discount;
|
||||
|
||||
|
|
|
|||
|
|
@ -71,9 +71,7 @@ class PercentOfProduct extends Action
|
|||
|
||||
$discount = round(($itemPrice * $discount_amount) / 100, 4) * $discQuantity;
|
||||
|
||||
if ($rule->action_type == 'percent_of_product') {
|
||||
$discount = $discount <= $itemPrice ? $discount : $itemPrice;
|
||||
}
|
||||
$discount = $discount <= $itemPrice * $discQuantity ? $discount : $itemPrice * $discQuantity;
|
||||
|
||||
$report['discount'] = $discount;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue