At the moment, upon going from free to non-free (eg. changing shipping method), the JS code will find the first enabled radio option and select it. In our case, we have a specific #default_value on the payment method that should make credit card the default method, even though it's not the first method in the list. With uc_free_order, it selects the first method instead when the user picks a non-free shipping option.

I've crafted a patch that makes the uc_free_order JS remember what the previous ticked option was prior to hiding it, then restores that when it re-enables those options. This also adds support for it to return the selection to their previous non-free selection they made if they went from paid to free and back again.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

gabriel.achille’s picture

FileSize
829 bytes

I have the same issue but I needed a slightly different solution: When a user is submitting the checkout form and for another reason (data missing somewhere else) the form is displayed again, the previous submitted payment method had been lost, back to the first non-free method.

The purpose of this patch is to retrieve the previously submitted payment method.

Maybe this issue have to be merge with http://drupal.org/node/984086 which seems to solve the bug even earlier in the process by avoiding the unneeded selection...