If your store is in Canada and USA customer tries to add their address in their address book, they will NOT see any states in the states select box.

The reason for this is because...

function address_form_fields($edit = array()) {
....
$country = ($edit['country'] ? $edit['country'] : variable_get('ec_country', 0));
// @return == 'ca' (because the store's default is Canada

$states = store_build_states($country);
// @return == empty array.

only way I could explain this :)

I'm going to hack the module to solve it for now so this client's site works but will be hoping for a patch soon :)

Comments

Anonymous’s picture

in case others encounter this... for my hackish fix i just did this..

line 397: $states = store_build_states($country);

change to: $states = store_build_states(($country == 'ca' ? 'us' : $country));
eclypsed’s picture

Thanks Steve,

That really did the trick! Hopefully this bug is fixed soon.

drew reece’s picture

This appears to be related to this issue…

http://drupal.org/node/242703

budda’s picture

Status: Active » Reviewed & tested by the community

This fix worked. Pitty it can't just be rolled in to the 3.x branch and packaged as a new release as it's annoying.

pfaocle’s picture

Version: 5.x-3.x-dev » 5.x-3.4
Status: Reviewed & tested by the community » Closed (duplicate)

Marking this as a duplicate of Typo in address.module for build_states option, which to me seems to be the proper fix.

carole’s picture

I tried both fixes, and they both work for the US but not Canada. My default location is Canada. I have EC Regions and the Locations module enabled. Do I have to enable or configure a list of provinces somewhere?

iancawthorne’s picture

Subscribed