Problem/Motivation
When using multiple checkout panes with AJAX submission it is possible to submit a second AJAX event before the first has finished updating the form. This issue manifests itself when the AJAX response is slow, for example when requesting live rates from a shipping service provider.
This can cause multiple save attempts to the order with outdated information causing revision conflicts and data loss.
Steps to reproduce
Apply a voucher code before the shipping rates have finished calculated.
Proposed resolution
Currently, Shipping and Promotion disable the "Continue to Review" button during the AJAX event, but this is insufficient as they also need to disable any other AJAX submission (I.e. Shipping needs to disable Coupon Redemption and visa versa).
It is not simple enough to disable the submit buttons, as changes to fields Shipping address can trigger the AJAX refresh.
Unless we add a flag on fields that can cause an AJAX submission the best option is to disable all input and buttons during the AJAX process.
This is a pessimistic action, but will also improve an experience with Commerce Shipping allows the shipping address to be changed while shipping rates are being recalculated, resulting in the address refreshing back to the last submitted address.
Remaining tasks
Add tests
User interface changes
All input fields will be disabled on checkout during AJAX refresh
Data model changes
None
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | commerce-checkout_ajax-3258458-2.patch | 2.01 KB | dwkitchen |
Comments
Comment #2
dwkitchen commentedThe proposed change is based on a similar issue in Better Exposed Filters #3084091: Disable filters while processing submission via AJAX