File tree Expand file tree Collapse file tree 2 files changed +11
-20
lines changed
app/code/Magento/Quote/Model Expand file tree Collapse file tree 2 files changed +11
-20
lines changed Original file line number Diff line number Diff line change @@ -2284,11 +2284,10 @@ public function validateMinimumAmount($multishipping = false)
2284
2284
$ taxes = ($ taxInclude ) ? $ address ->getBaseTaxAmount () : 0 ;
2285
2285
foreach ($ address ->getQuote ()->getItemsCollection () as $ item ) {
2286
2286
/** @var \Magento\Quote\Model\Quote\Item $item */
2287
- if ($ includeDiscount ) {
2288
- $ amount = $ item ->getBaseRowTotal () - $ item ->getBaseDiscountAmount () + $ taxes ;
2289
- } else {
2290
- $ amount = $ taxInclude ? $ item ->getBaseRowTotalInclTax () : $ item ->getBaseRowTotal ();
2291
- }
2287
+ $ amount = $ includeDiscount ?
2288
+ $ item ->getBaseRowTotal () - $ item ->getBaseDiscountAmount () + $ taxes :
2289
+ $ item ->getBaseRowTotal () + $ taxes ;
2290
+
2292
2291
if ($ amount < $ minAmount ) {
2293
2292
return false ;
2294
2293
}
@@ -2298,11 +2297,9 @@ public function validateMinimumAmount($multishipping = false)
2298
2297
$ baseTotal = 0 ;
2299
2298
foreach ($ addresses as $ address ) {
2300
2299
$ taxes = ($ taxInclude ) ? $ address ->getBaseTaxAmount () : 0 ;
2301
- if ($ includeDiscount ) {
2302
- $ baseTotal += $ address ->getBaseSubtotalWithDiscount () + $ taxes ;
2303
- } else {
2304
- $ baseTotal += $ taxInclude ? $ address ->getBaseSubtotalTotalInclTax () : $ address ->getBaseSubtotal ();
2305
- }
2300
+ $ baseTotal += $ includeDiscount ?
2301
+ $ address ->getBaseSubtotalWithDiscount () + $ taxes :
2302
+ $ address ->getBaseSubtotal () + $ taxes ;
2306
2303
}
2307
2304
if ($ baseTotal < $ minAmount ) {
2308
2305
return false ;
Original file line number Diff line number Diff line change @@ -1159,17 +1159,11 @@ public function validateMinimumAmount()
1159
1159
$ storeId
1160
1160
);
1161
1161
1162
- if ($ includeDiscount ) {
1163
- $ taxes = $ taxInclude ? $ this ->getBaseTaxAmount () : 0 ;
1162
+ $ taxes = $ taxInclude ? $ this ->getBaseTaxAmount () : 0 ;
1164
1163
1165
- $ isMinimumReached = ($ this ->getBaseSubtotalWithDiscount () + $ taxes >= $ amount );
1166
- } else {
1167
- $ isMinimumReached = $ taxInclude
1168
- ? ($ this ->getBaseSubtotalTotalInclTax () >= $ amount )
1169
- : ($ this ->getBaseSubtotal () >= $ amount );
1170
- }
1171
-
1172
- return $ isMinimumReached ;
1164
+ return $ includeDiscount ?
1165
+ ($ this ->getBaseSubtotalWithDiscount () + $ taxes >= $ amount ) :
1166
+ ($ this ->getBaseSubtotal () + $ taxes >= $ amount );
1173
1167
}
1174
1168
1175
1169
/**
You can’t perform that action at this time.
0 commit comments