Skip to content

Commit 90563cc

Browse files
Chhandak.BaruaChhandak.Barua
authored andcommitted
ACP2E-285: Add to cart failed when cart total is zero and cart price rule is Fixed amount discount for whole cart
1 parent c8e86d9 commit 90563cc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/code/Magento/SalesRule/Helper/CartFixedDiscount.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public function getDiscountedAmountProportionally(
109109
string $discountType
110110
): float {
111111
$baseItemPriceTotal = $baseItemPrice * $qty - $baseItemDiscountAmount;
112-
$ratio = $baseItemPriceTotal / $baseRuleTotalsDiscount;
112+
$ratio = $baseRuleTotalsDiscount != 0 ? $baseItemPriceTotal / $baseRuleTotalsDiscount : 0;
113113
$discountAmount = $this->deltaPriceRound->round($ruleDiscount * $ratio, $discountType);
114114
return $discountAmount;
115115
}

0 commit comments

Comments
 (0)