Skip to content

Commit c7af28a

Browse files
committed
Merge remote-tracking branch 'origin/MAGETWO-98028' into 2.3-develop
2 parents ef58edb + 1b6d64c commit c7af28a

File tree

5 files changed

+131
-79
lines changed

5 files changed

+131
-79
lines changed

app/code/Magento/SalesRule/Model/Validator.php

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,8 @@ protected function _getRules(Address $address = null)
182182
}
183183

184184
/**
185+
* Address id getter.
186+
*
185187
* @param Address $address
186188
* @return string
187189
*/
@@ -327,21 +329,7 @@ public function processShippingAmount(Address $address)
327329
$baseDiscountAmount = $rule->getDiscountAmount();
328330
break;
329331
case \Magento\SalesRule\Model\Rule::CART_FIXED_ACTION:
330-
$cartRules = $address->getCartFixedRules();
331-
if (!isset($cartRules[$rule->getId()])) {
332-
$cartRules[$rule->getId()] = $rule->getDiscountAmount();
333-
}
334-
if ($cartRules[$rule->getId()] > 0) {
335-
$quoteAmount = $this->priceCurrency->convert($cartRules[$rule->getId()], $quote->getStore());
336-
$discountAmount = min($shippingAmount - $address->getShippingDiscountAmount(), $quoteAmount);
337-
$baseDiscountAmount = min(
338-
$baseShippingAmount - $address->getBaseShippingDiscountAmount(),
339-
$cartRules[$rule->getId()]
340-
);
341-
$cartRules[$rule->getId()] -= $baseDiscountAmount;
342-
}
343-
344-
$address->setCartFixedRules($cartRules);
332+
// Shouldn't be proceed according to MAGETWO-96403
345333
break;
346334
}
347335

@@ -519,6 +507,8 @@ public function sortItemsByPriority($items, Address $address = null)
519507
}
520508

521509
/**
510+
* Rule total items getter.
511+
*
522512
* @param int $key
523513
* @return array
524514
* @throws \Magento\Framework\Exception\LocalizedException
@@ -533,6 +523,8 @@ public function getRuleItemTotalsInfo($key)
533523
}
534524

535525
/**
526+
* Decrease rule items count.
527+
*
536528
* @param int $key
537529
* @return $this
538530
*/

0 commit comments

Comments
 (0)