VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: reinhold on November 16, 2012, 14:16:16 PM

Title: Is there any function to format addresses in a country-specific way?
Post by: reinhold on November 16, 2012, 14:16:16 PM
As each country has its own address format (needed e.g. for the invoices), it doesn't make sense in my invoice templates to try to format the invoice address manually, as that will break for foreign countries. Rather, the format needs to depend on the country of the address.
It seems that currently the invoice templates (e.g. mail_html_shopperaddresses.php or invoice.php) have the central-European format hardcoded and will break with any other country.

Is there any function in virtuemart that is able to format a given (shipping, billing or vendor) address according to the local standards of the respective country?

Thanks,
Reinhold

PS: The wikipedia article http://en.wikipedia.org/wiki/Address_%28geography%29#Mailing_address_format_by_country gives examples of >50 different countries, which have all different kinds of address formating...
And there is an even more concise page: http://www.columbia.edu/~fdc/postal/