Skip to content

Commit f749e83

Browse files
author
Anna Bukatar
committed
ACP2E-1196: Minimum order amount error when discount rule is applied for shipping amount
1 parent 5a022f6 commit f749e83

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

app/code/Magento/Quote/Model/Quote/Address.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1228,9 +1228,10 @@ public function validateMinimumAmount()
12281228
? $this->getBaseTaxAmount() + $this->getBaseDiscountTaxCompensationAmount()
12291229
: 0;
12301230

1231+
// Note: ($x > $y - 0.0001) means ($x >= $y) for floats
12311232
return $includeDiscount ?
1232-
($this->getBaseSubtotalWithDiscount() + $taxes >= $amount) :
1233-
($this->getBaseSubtotal() + $taxes >= $amount);
1233+
($this->getBaseSubtotalWithDiscount() + $taxes > $amount - 0.0001) :
1234+
($this->getBaseSubtotal() + $taxes > $amount - 0.0001);
12341235
}
12351236

12361237
/**
@@ -1386,7 +1387,7 @@ public function getBaseTotalAmount($code)
13861387
*/
13871388
public function getBaseSubtotalWithDiscount()
13881389
{
1389-
return $this->getBaseSubtotal() + $this->getBaseDiscountAmount();
1390+
return $this->getBaseSubtotal() + $this->getBaseDiscountAmount() + $this->getBaseShippingDiscountAmount();
13901391
}
13911392

13921393
/**

0 commit comments

Comments
 (0)