It would be cool to add preset address formats for every country to the xy.inc files. We could start with what we have (and otherwise use the default format), and add the preset address format for other countries on request. I'm gonna take a look at this as well.

Comments

pancho’s picture

To start collecting:

us:

!aname
!additional
!street
!city, !province_code !postal_code
!country_name

au:

!aname
!additional
!street
!CITY !province_name !postal_code
!country_name

br:

!aname
!additional
!street
!province_name !city
!postal_code
!country_name

cn:

!aname
!additional
!street, !city
!postal_code, !province_name
!country_name

cz:

!aname
!additional
!street
!city
!postal_code
!country_name

de:

!aname
!additional
!street
!postal_code !city
!country_name

hu:

!aname
!additional
!city
!street
!postal_code
!country_name

it:

!aname
!additional
!street
!postal_code !city !province_code
!country_name

nl:

!aname
!additional
!street
!postal_code !province_code !city
!country_name

nz:

!aname
!additional
!street
!city !postal_code
!country_name
Phylock’s picture

dk:

!aname
!additional
!street
!postal_code !city
!country_name

we aint using the province parameter, didn't even know we had them until i was looking around in the module files.

VeeLin’s picture

That would be great because creating a Canadian site and having to put up with "State / Province" isn't that great. I haven't edited Drupal code before although I'm somewhat familiar with PHP so if you wouldn't mind letting me know where I can edit this manually in the meantime that would be great.

V

Phylock’s picture

That would be great because creating a Canadian site and having to put up with "State / Province" isn't that great. I haven't edited Drupal code before although I'm somewhat familiar with PHP so if you wouldn't mind letting me know where I can edit this manually in the meantime that would be great.

V

You can do it in two places, if you only use a couple of themes put it in your theme "template.php" file. but if you use a lot of themes it might be easier to put it directly in the module /addresses/countries/[country code].inc
the function

function addresses_address_format_[country code]() {
  return "!aname
          !street
          !additional
          !city, !postal_code
          !country_name";
}

where [country code] is replaced with the desired country code, example ca for Canada

the possible tokens are

  • !primary
  • !aname
  • !street
  • !additional
  • !city
  • !postal_code
  • !province_code
  • !province_name
  • !country_code2
  • !country_code3
  • !country_name

hope it helps a little

brmassa’s picture

Status: Active » Fixed
Issue tags: +country data

Guys,

thanks a lot. These data is now present on CVS. soon on the next release.

regards,

massa

Status: Fixed » Closed (fixed)
Issue tags: -country data

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