Drupal 7 asks for a country at install time, so let's use that to prepopulate the store settings instead of defaulting to the US.

Comments

longwave’s picture

Status: Active » Postponed

Drupal stores the default country with the 2-character ISO code, which Ubercart doesn't know about without installing CIF files.

Postponed until #1062548: Unify CIFs between versions

SilviuChingaru’s picture

Now that #1062548: Unify CIFs between versions we should look again into this to see if there is still something to do.

longwave’s picture

We still can't do this, as the site default country is a 2 character ISO code, and we can't determine which CIF file to install without installing them all. This is probably something to reconsider in Drupal 8 now.

SilviuChingaru’s picture

Or we can write a map like:

$map = array(
  '[ISO code 2]' => '[ISO code 3]',
  // ...
);

A source can be found here: http://drupalcode.org/project/countries.git/blob/refs/heads/7.x-2.x:/cou...

TR’s picture

The original authors of Ubercart made the unfortunate choice of using the three-digit numeric country code (not the 3 character or 2 character ISO code) as the main country identifier. No one else really uses that number for anything. This is something we will be changing in D8, but for D7 we'd have to make our own 'map' and that's a lot of effort/code just to set the default country.

I personally don't mind the fact that the store country isn't set automatically - this forces the site owner to visit that screen where a LOT of other information needs to be set for everything to work correctly. If anything, I would put the effort into coding a banner (with link to settings) on every Ubercart page if the all the required settings haven't been assigned. Sort of like our Store Status pane at the bottom of /admin/store that no one ever sees because it's below the fold.

longwave’s picture

Version: 7.x-3.x-dev » 8.x-4.x-dev
Issue summary: View changes

I don't think it's worth thinking about this in 7.x now, but may be possible depending on our final countries implementation in 8.x.

  • TR committed 27d57f5 on 8.x-4.x
    Issue [#1092734]: Use site default country as store country. US and CA...
TR’s picture

Status: Postponed » Fixed

Now fixed in 8.x-4.x. This will not be backported to 7.x-3.x, as it required major architectural changes which would break many contributed modules in 7.x-3.x. (Commit 27d57f5 is just the last of many commits which were part of this fix).

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.