Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
longwaveDrupal 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
Comment #2
SilviuChingaru CreditAttribution: SilviuChingaru commentedNow that #1062548: Unify CIFs between versions we should look again into this to see if there is still something to do.
Comment #3
longwaveWe 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.
Comment #4
SilviuChingaru CreditAttribution: SilviuChingaru commentedOr we can write a map like:
A source can be found here: http://drupalcode.org/project/countries.git/blob/refs/heads/7.x-2.x:/cou...
Comment #5
TR CreditAttribution: TR commentedThe 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.
Comment #6
longwaveI 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.
Comment #8
TR CreditAttribution: TR commentedNow 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).