Skip to content
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

Check if coupon availaible with discount condition formula #1705

Merged
merged 1 commit into from Sep 4, 2020
Merged

Check if coupon availaible with discount condition formula #1705

merged 1 commit into from Sep 4, 2020

Conversation

fhamon
Copy link

@fhamon fhamon commented Sep 3, 2020

The problem

Craft's commerce does not return an error when a user wants to add an existing coupon code to the cart via the action commerce/cart/update-cart and the order condition formula did not pass.

The solution

I added this simple check based on your code style and existing code to validate and send an error when the coupon is not valid because of the condition formula.

Please let me know if this PR is problematic, I am ready to change the code or adapt to your guidelines.

Thanks for Craft and thanks for the commerce plugin. Much love from Montreal ❤

@lukeholder lukeholder merged commit 9fa3cc5 into craftcms:develop Sep 4, 2020
@lukeholder
Copy link
Member

Thanks for that!

@lukeholder
Copy link
Member

Changelog entry: 3af212e

@fhamon fhamon deleted the order-coupon-availaible-conditions-check branch September 4, 2020 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants