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

Purge incomplete carts not respecting timezone #2588

Closed
engram-design opened this issue Oct 14, 2021 · 1 comment
Closed

Purge incomplete carts not respecting timezone #2588

engram-design opened this issue Oct 14, 2021 · 1 comment
Labels

Comments

@engram-design
Copy link
Contributor

engram-design commented Oct 14, 2021

Looking at the purge incomplete carts code:

->andWhere('[[orders.dateUpdated]] <= :edge', ['edge' => $edge->format('Y-m-d H:i:s')])

This will not always be in UTC, which the timestamp for dateUpdated is recorded in. Instead it'll be in the configured time (sometimes local time, sometimes UTC). It's be a good idea to use the Db::prepareDateForDb() function:

Changing

$edge->format('Y-m-d H:i:s')

to

Db::prepareDateForDb($edge)

should ensure we're comparing dates in UTC properly.

@lukeholder
Copy link
Member

Thanks for reporting, fixed for the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants