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

Changes to fields are not saved to the server while an ajax request is in progress #8

Open
jdukeukpos opened this issue Mar 18, 2016 · 0 comments
Assignees
Labels

Comments

@jdukeukpos
Copy link

Because a step does not send data to the server if it is already in the process of sending data then there is the possibility of the data that the user sees in the checkout being out of sync with the data that the server holds.

This causes support issues when the user thinks that they have specified one thing, like ship to France but Magento has another, like ship to the UK

This situation can easily be observed on a development environment where caching is switched off; meaning ajax request take longer than on a live environment

To recreate:

  • Uncheck "Use same address for shipping"
  • select "New address"
  • ensure the rest of the form is ready for submission
  • type in the address field and wait for the saveShipping ajax to fire (visible in the network tab of browser's developer extension)
  • while ajax is being submitted change the country
  • submit the order

Viewing the order in Magento will show that the change of country was not saved

A solution to this problem would be to do the following:

  • change the step's this.updater to be an intermediate method which then calls the this.submit() method
  • change the onComplete and onFail callbacks to intermediate method as well
  • the updater intermediate method could then call the this.submit() method if its not already submitting otherwise flag that the this.submit() method needs to be re-called after completion/failure of the current request
  • the onComplete and onFail intermediate functions can then clear flags and re-call the this.submit() where required
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