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

Session stores old order id even if order was deleted, causing error on next checkout. #12800

Open
ndeet opened this issue Oct 19, 2023 · 4 comments
Assignees

Comments

@ndeet
Copy link

ndeet commented Oct 19, 2023

OpenCart 4.0.2.3

Describe the bug
Under certain rare circumstances the session stores an non-existing order id. If a user abandons checkout and an admin deletes that pending order in the meantime. If the user returns before their session expired the session will still pass that old (non existing) order id causing an error on checkout if the payment module relies on it.

To Reproduce
Steps to reproduce the behavior:

  1. Customer: Go through checkout but abort the order at the payment provider
  2. Customer: deletes his cart (likely not needed for this error to show but not tested)
  3. Admin: deletes the abandoned order
  4. Customer: returns with old session not timed out and tries to checkout again
  5. $this->session->data['order_id'] still contains the old order id and checkout fails if there is anything relying on that order id.

Expected behavior
The cart should imo check if the order id still exists in the system at some point before processing the payment to make sure it does not error.

Server / Test environment (please complete the following information):

  • DDEV (docker setup)
  • Linux Ubuntu 22.04 LTS
  • PHP 8.1.23
  • Nginx
  • Browser(s) tested with Chrome 118
@chongshengdz
Copy link
Contributor

did you clear all your cache?

@danielkerr
Copy link
Member

dont delete orders that have not been completed

@ndeet
Copy link
Author

ndeet commented Oct 23, 2023

dont delete orders that have not been completed

Maybe then they should not be deletable or only after some grace period?

As said this rarely happens and likely is due to testing but still very hard to debug and not a nice UX for customers if they run into it.

@hayden-t
Copy link
Contributor

generally incomplete orders dont show in the admin ?

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

No branches or pull requests

4 participants