Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change standard address format on Magento Frontend

Tags:

magento

I want to change Magento's standard address format on the customer address page. How can I do that?

For those who don't know the address format, it is the method in wich we write the address. For example, the english format for France is this:

Addressee (Natural person/Organization)
More detailed description of addressee (optional)
Housenumber + Streetname
Postal code + uppercase town
Country (if other than France)

The address format for the USA is this:

Name of address
Street number and name
Name of town, State abbreviation + ZIP code
(typical handwritten format)

You can read more at wikipedia. Thanks a lot.

like image 991
Ahmed Ala Dali Avatar asked Apr 04 '11 10:04

Ahmed Ala Dali


2 Answers

It seems that the config.xml file is no longer used (or just to load the default values into the database).

Go to:

System->Configuration->Customer->Customer Configuration and scroll down to Address Templates.

There you find the same code as in the XML file.

like image 188
Markus Quaritsch Avatar answered Oct 04 '22 05:10

Markus Quaritsch


Generally speaking the address formats are contained in app/code/core/Mage/Customer/config.xml look for some markup like this:

...

<default>
  <customer>
    <address_formats> 
     <text><![CDATA[{{depend prefix}}{{var prefix}} {{/depend}}{{var firstname}} {{depend middlename}}{{var middlename}} {{/depend}}{{var lastname}}{{depend suffix}} {{var suffix}}{{/depend}}
{{depend company}}{{var company}}{{/depend}}
{{if street1}}{{var street1}}
{{/if}}
{{depend street2}}{{var street2}}{{/depend}}
{{depend street3}}{{var street3}}{{/depend}}
{{depend street4}}{{var street4}}{{/depend}}
{{if city}}{{var city}},  {{/if}}{{if region}}{{var region}}, {{/if}}{{if postcode}}{{var postcode}}{{/if}}
{{var country}}
T: {{var telephone}}
{{depend fax}}F: {{var fax}}{{/depend}}}]]></text>
    </address_templates>
  </customer>
</default>

...

like image 45
Aaron Bonner Avatar answered Oct 04 '22 04:10

Aaron Bonner