-
-
Notifications
You must be signed in to change notification settings - Fork 437
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
The coupon is not valid and discount is not applied #4409
base: main
Are you sure you want to change the base?
Conversation
Id change the code to not call |
Mhh, i think that the original code works as expected. To make a coupon valid only for this this set "to date" to the next day. (thats 00:00:00) - but that unintentional. I have tested your code, but it does enot work for me. I have an one-day offset in comparison. Wait for PR ... |
Quality Gate passedIssues Measures |
It solves the issue reported here #4401.
Preconditions
OpenMage version 20.6.0
PHP 8.0
Steps to reproduce
Setup a cart promo rule with a specific coupon. Set both start date and end date with current date.
Go to fronted, add a product to cart and go to the cart page
Try to apply the coupon
Expected result
The coupon is valid and discount is applied
Actual result
The coupon is not valid and discount is not applied
In this piece of code the coupon expiration date is compared to the current datetime, but coupon expiration date always has 00:00:00 time, so that if the expiration day is today, that check cannot pass. Dates should be compared without considering time, like it's done in the Collection where the promo validity dates are compared to $now, and $now is a date without time.