Skip to content

Commit 2133bad

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 83e5f9b commit 2133bad

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
@@ -127,7 +127,7 @@ public function getShippingDiscountAmount(
127127
float $shippingAmount,
128128
float $quoteBaseSubtotal
129129
): float {
130-
$ratio = $shippingAmount / $quoteBaseSubtotal;
130+
$ratio = $quoteBaseSubtotal != 0 ? $shippingAmount / $quoteBaseSubtotal : 0;
131131
return $this->priceCurrency
132132
->roundPrice(
133133
$rule->getDiscountAmount() * $ratio

0 commit comments

Comments
 (0)