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

[3.x] Instantly disable the place order button #165

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Jade-GG
Copy link
Collaborator

@Jade-GG Jade-GG commented Jan 30, 2025

Right now it is possible to accidentally place 2 orders from one cart, either because they have a broken mouse or they accidentally click twice. There appears to be a race condition where it's actually possible to bypass the check magento does to try and make sure you can't do this.

This PR instantly disables the button so that it is impossible for this to happen (at least, by accident). Previously, this disabled state was based on the $root.loading variable which is not instant, as its value is waiting for a watcher and the async fetching functions.

I made sure to check and this addition does not break reactivity with the default disabled state. In other words, if the order placing fails, the button will stop being disabled again like it should.

@royduin
Copy link
Member

royduin commented Jan 31, 2025

  • When something is going wrong with the request the button will change back to "enabled"?
  • Do we also need any changes in confira or the core?
  • Do we also need this on other buttons? Like the add to cart button?

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.

3 participants