-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cart Price rules without coupons are not processed when coupon is applied #2931
Comments
I'm having this issue as well. @hatimeria-artur-jewula did the change to |
My solution was in separate module in
In the collection class I override
just before
to
|
Hi @hatimeria-artur-jewula, thank you for issue report! Internal ticket MAGETWO-54440 was created. |
this seems still present in 2.1.1 |
Hi @hatimeria-artur-jewula |
@davepyro here's a patch: |
Great thanks |
@heldchen - Sorry, Im new to Mag2. How can I use your patch. I can see it's a .diff file. |
you apply the diff file with a patch tool to your codebase... |
This is a very important fix - when is this getting incorporated in one of the future releases? |
Beware of the parent::_initSelect() line though. If you extend the original class to only overwrite that one method, it will throw an exception, if you keep it as is. Must be changed to be AbstractCollection::_initSelect(). And I second the question for an official fix. Is anyone even still assigned to the issue? |
Hi, seems cart price rules is still not working properly yet in Magento 2.1.3. |
@hatimeria-artur-jewula, thank you for your report. |
Yes, this was fixed some time ago. |
I have stumbled on strange situation in Magento2. I have 2 cart price rules defined. First one has no conditions, no coupon, applied to all customer groups and websites, and grants 10% discount. This rule is successfully applied to cart after first item is added. I can see discount value set to 10%.
Example:
![cart-rule-1](https://cloud.githubusercontent.com/assets/16100846/12197883/50ea0e40-b60b-11e5-8acb-90bf0e1b24bd.png)
Now I have a second rule that uses specific coupon provided in rule and fixed discount of $5. When I enter the code into "Apply Discount Code" field I notice that it is being applied but the first one is not. Only coupon rule is being applied
Both rules have "Discard subsequent rules" set to no and no-coupon rule's priority is 0 whereas coupon rule's priority is 5. I would assume that both should be applied.
I dig into
Magento\SalesRule\Model\ResourceModel\Rule\Collection
class and found out that it produces the following query that fetches rules to check in methodsetValidationFilter()
The problematic line is
AND rule_coupons.code = 'ABC'
which removes all rules without coupons. I belive this should be set asAND (rule_coupons.code = 'ABC' OR (main_table.coupon_type = 1))
The text was updated successfully, but these errors were encountered: