In my example, address format is specific for France (no region, and postcode before city).
What about providing Magento team with address format of your own country ? So that they can integrate it in the database of stable version.
In my case, i don’t know how i should write down an address for Netherlands (even if it’s not far from France...). It would be better to centralize this, no ?
What about providing Magento team with address format of your own country ? So that they can integrate it in the database of stable version.
In my case, i don’t know how i should write down an address for Netherlands (even if it’s not far from France...). It would be better to centralize this, no ?
Sounds like a great idea to me, SeL. And for the record, here’s the format for the Netherlands:
Jan Smits
Groteweg 124
1234AB Stadergens
That is:
First name Last name
Street name House number
Postcode City
Address formatting (and selection process for the user) has always been a major PITA. I would take a good look at PayPal and how they setup their registration form on a per country basis, because as the OP pointed out, someone in France has a different way of looking at an order form’s contact information compared to someone in, say, the US or England. They have different terminology and even a different order structure, e.g. Postal Code, ZIP Code, Postcode, etc. Some countries don’t have a State/Province, and some (like France) have things in an order that’s not the same as you would expect.
It would be great if Magento could organize the order form like this using JS to determine a lot of different information depending on what was entered. I actually have a pretty big PHP class that models PayPal and some other sources very well depending on the country selected. For example, if you select US as the country, it only shows US States with a drop down, or if you choose Canada only shows the provinces.
It’s a big task (of course) to get something like this organized, but data entry and formatting that’s not controlled by the user is something I personally look for.
Who knows, you might even have to call up some embassies or do some research on what the common naming conventions are and so on and to come up with the correct regex for each country, but that would be something very, very useful and powerful.
After a few tries, i was able to define postal address format for different countries.
Magento does it perfectly
By inserting format in directory_country_format table, you’ll have your addresses formated as you wish.
For each country, there are 3 format types to take into account:
- HTML
- TEXT
- PDF
Here is my SQL command to have address format for France:
It would be very nice if this ever gets implemented to be able to choose if you want to print the customer’s VAT# which is very useful when using Magento to do B2B
@Roland, I have the same question. I can find something in the core file : country.php: But I don’t want to change the core, right? And I’m not sure this one provides the address formatting....
I really wonder why it’s not possible to custom define the address format, this is e.g. a default feature in osCommerce. There are 5 address formats to choose from on a per country basis.