diff --git a/packages/Webkul/Discount/src/Actions/Cart/FixedAmount.php b/packages/Webkul/Discount/src/Actions/Cart/FixedAmount.php index d6da32bb9..08b7eb47b 100644 --- a/packages/Webkul/Discount/src/Actions/Cart/FixedAmount.php +++ b/packages/Webkul/Discount/src/Actions/Cart/FixedAmount.php @@ -39,7 +39,7 @@ class FixedAmount extends Action if ($apply()) { if ($rule->action_type == 'whole_cart_to_fixed') { - $eligibleItems = \Cart::getItems(); + \Cart::getCart()->items } foreach ($eligibleItems as $item) { @@ -51,8 +51,6 @@ class FixedAmount extends Action $discQuantity = $itemQuantity <= $discQuantity ? $itemQuantity : $discQuantity; - $totalDiscount = $totalDiscount + $discount; - $report = array(); $report['item_id'] = $item->id; @@ -68,6 +66,8 @@ class FixedAmount extends Action $impact->push($report); + $totalDiscount = $totalDiscount + $discount; + unset($report); } } diff --git a/packages/Webkul/Discount/src/Actions/Cart/PercentOfProduct.php b/packages/Webkul/Discount/src/Actions/Cart/PercentOfProduct.php index 7eb3c2653..46343b847 100644 --- a/packages/Webkul/Discount/src/Actions/Cart/PercentOfProduct.php +++ b/packages/Webkul/Discount/src/Actions/Cart/PercentOfProduct.php @@ -46,7 +46,7 @@ class PercentOfProduct extends Action if ($apply()) { if ($rule->action_type == 'whole_cart_to_percent') { - $eligibleItems = \Cart::getItems(); + $eligibleItems = \Cart::getCart()->items; } foreach ($eligibleItems as $item) {