Download & Extend

Changing country on checkout = silent failure

Project:Drupal Commerce
Version:7.x-1.5
Component:Checkout
Category:support request
Priority:normal
Assigned:Unassigned
Status:postponed (maintainer needs more info)

Issue Summary

Working with a site that sells e-courses and other non-shippable stuff, so there is only one customer profile address (billing info). Users must register to use the site, so the customer profile billing address is linked to the user profile address field.

In checkout, if the billing address country is changed to something other than the value in the user's profile address, the checkout process silently fails: form submits and returns the same checkout page with no messages, error or otherwise. (Expected behaviour: move forward to order review.)

If the user edits their profile address, changing the country, then they can checkout with that same country. (So the problem isn't the countries themselves. It seems to be changing the value in the cart to a different value than in the user profile.) The customer profile billing address and the user profile address field have identical settings.

Happens with and without JS turned on.

Comments

#1

Category:bug report» support request
Status:active» postponed (maintainer needs more info)

Without JS turned on, that's the expected behavior for Drupal's #ajax system in the Forms API. We set the form to rebuild, and since it can't do it via AJAX, when you submit the form it will rebuild and display the same form without submitting it.

When you have JS turned on - not sure. We'll need to know what other modules / customizations you have on there, what browser you're using, if any errors are turning up in the watchdog or logs, and perhaps if you have issues with other #ajax related functionality.

#2

I have been testing in FF + Crome on Linux, but it was reported from users using FF + IE on Windows. Nothing in the logs.

AJAX works fine in other places: views slideshows and so on. I don't think there are any other ajax forms, however.

There are lots of cart + product customizations, but very little once we reach checkout. Pretty much just one piece of custom validation, but it's pretty straightforward (it's added to $form['buttons']['continue']['#validate'][] in a form_alter function):

function btcommerce_checkout_valid_postal_code($form, &$form_state) {
$address = $form_state['values']['customer_profile_billing']['commerce_customer_address'][LANGUAGE_NONE][0];
$result = postal_code_validation_validate($address['postal_code'], $address['country']);

if (!$result || $result['postal_code'] == FALSE) {
$err = !empty($result['error']) ? $result['error'] : 'Postal code error';
form_set_error('', t($err));
}
}

#3

Version:7.x-1.4» 7.x-1.5

Hi

I have exactly the same issue as Steve, with Commerce 1.5. No errors in the logs and no relevant customisations.
Is there any progress or are there any workarounds for this problem?

I think the problem started when I installed the commerce_eu_vat module, but I'm not sure. I'm gonna disable the module and check if it has any effect.

Thanks in advance!

nobody click here