Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
See https://drupal.org/node/1982560
If the 'continue' button on the checkout form is pressed while shipping is being calculated an ajax error is thrown, and the calculation results are unpredictable.
The continue button should be disabled while this ajax operation is happening.
Comment | File | Size | Author |
---|---|---|---|
#1 | commerce_shipping_disable_continue_button_when_ajax_performed.patch | 1.85 KB | sinn |
Comments
Comment #1
sinn CreditAttribution: sinn commentedI had similar issue: if we change address field and then right away press Continue, address isn't copied. If we click Continue right away after changing form item 2 ajax started at the same time.
Patch attached.
Comment #2
stefank CreditAttribution: stefank commented@sinn Thanks,
That works for me, as the ajax callback was just hanging, when an user changed some field in address e.x. country and then fast clicked the continue button.
Comment #3
googletorp CreditAttribution: googletorp commentedI'm not too fond of this solution, since it overwrites the complete function which could be anything. If things were to change, we would have to maintain it in the module.
I would like to see a solution where we don't have to altering cores AJAX handling.
Comment #4
Rodlangh CreditAttribution: Rodlangh commented@sinn
Could you explain why you copy the checkout button before disabling it in your patch? Is it necessary?
Comment #5
sinn CreditAttribution: sinn commented@ Rodlangh
Copied checkout button is fake without click event. We need this one to because we don't know exactly what events are in original button.
In another case we need to remove/add click event every time. I think it is more complicated.
Comment #6
IckZ CreditAttribution: IckZ commentedany other idea how to solve this? I have the same problem.
Comment #7
googletorp CreditAttribution: googletorp commentedComment #8
donquixote CreditAttribution: donquixote commentedHow is this "outdated"?
It still applies today.
See #2938233: Shipping cost based on outdated address with one-page ajax checkout