diff --git a/vendor/magento/module-sales-rule/Model/Quote/Discount.php b/vendor/magento/module-sales-rule/Model/Quote/Discount.php index 19e9bdf377bf..fcefae81780e 100644 --- a/vendor/magento/module-sales-rule/Model/Quote/Discount.php +++ b/vendor/magento/module-sales-rule/Model/Quote/Discount.php @@ -188,6 +188,21 @@ public function collect( if ($item->getNoDiscount() || !$this->calculator->canApplyDiscount($item) || $item->getParentItem()) { continue; } + + switch ($rule->getSimpleAction()) { + case Rule::BY_PERCENT_ACTION: + case Rule::BY_FIXED_ACTION: + if ($rule->getDiscountStep() > $item->getQty()) { + continue 2; + } + break; + case Rule::BUY_X_GET_Y_ACTION: + if ($rule->getDiscountStep() >= $item->getQty()) { + continue 2; + } + break; + } + $eventArgs['item'] = $item; $this->eventManager->dispatch('sales_quote_address_discount_item', $eventArgs); $this->calculator->process($item, $rule);