When selecting another payment method during the first checkout step, the checkout process gets stuck in the first step. The form is submitted but the user is led right back to step 1, without any error messages (checked the log as well).

From there:

  • Submitting the form again, doesn't work either
  • Switching the payment method back to the first and then to the second one again, and then submitting, successfully proceeds to step 2

Something that I've noticed:

This only occurs if the payment method is switched before the form is filled out completely. If I first fill out all the form fields and only then switch the payment method, the submission of the form works and I can proceed to step 2.

So basically if I switch the payment method before completely filling out the rest of the form, I am stuck in the first checkout step. Any ideas what might be causing this?

Comments

mobweb’s picture

We figured out that the cause of this problem is an ajax call that is sent while the user is filling out the form. One such call was placed by the "Commerce Shipping" module, and it was named "Recalculate Shipping". We completely disabled that logic, and now it seems to be working and the bug is gone. However, if the user switches the shipping country, another such ajax call is made (to check if the newly selected country has a "Postal Code" field among others).

So the problem seems to be caused by these ajax calls. If such a call is made and the payment method is switched afterward, the checkout won't advance past the first step. What's really odd about this is that we inspected all the data that is sent and received via these calls, and the data is identical with and without the bug occurring. If somebody would like to take a look at this I'll happily provide the debugging logs that I created with the various ajax data!

luksak’s picture

mobweb and me are working on the same project. After disbling all possibly related modules and setting the theme to Bartik, I discovered that disabling the "Calculate shipping rates via AJAX as addresses are updated on the checkout form. " on the shipping payment pane solved the issue. How is this related to payment?

xano’s picture

Thanks for reporting this issue. Payment uses some AJAX to refresh the payment method-related form elements when a different method is selected. Maybe this clashes with some of Commerce's code.

luksak’s picture

Yes, it seems to. How can we fix this?

xano’s picture

Please provide step-by-step instructions on how to reproduce the problem on a clean install using Drupal 7.x-dev, Payment 7.x-1.x-dev and Payment for Drupal Commerce 7.x-1.x-dev. Otherwise other people won't have the possibility to examine the problem.

xano’s picture

Status: Active » Closed (cannot reproduce)

Closing this due to lack of response.