Address formats - what are they?
How addresses are displayed in different countries
You may have noticed the address format value ranges between 1 and 6. The Uk is 6 and most other countries are 1. What exactly is the ‘format’ ?
Address formats are based on international ISO standard formats.
In Zen Cart, formats are stored in the address_format
table.
This table is structured as follows:
Columns
address_format_id
- A unique, auto incremented value, to identify each address format record.
Type: int(11) Null: No Default: Extra: auto_increment
address_format
- The format used for displaying the shipping/billing address.
Type: varchar(128) Null: No Default:
Possible variables are:
- $firstname - first name
- $lastname - last name
- $cr - forces line break
- $streets - street address
- $city - city
- $state - state
- $statecomma - state followed by a comma and a space
- $postcode - postcode
- $country - country
- Punctuation, spaces and other characters can be added as well before or after the variables
address_summary
- Summary of the address format used for display purposes.
Type: varchar(48) Null: No Default:
Default Entries
The default entries can be seen in the file zc_install/sql/install/mysql_zencart.sql
.
As of Zen Cart 1.5.6, they are:
ID | Value |
1 | $firstname $lastname $streets $city, $postcode $statecomma$country,$city / $country |
2 | $firstname $lastname $streets $city, $state $postcode $country,$city, $state / $country |
3 | $firstname $lastname $streets $city $postcode - $statecomma$country,$state / $country |
4 | $firstname $lastname $streets $city ($postcode) $country, $postcode / $country |
5 | $firstname $lastname $streets $postcode $city $country,$city / $country |
6 | $firstname $lastname $streets $city $state $postcode $country,$postcode / $country |
7 | $firstname $lastname $streets $city $state $postcode $country,$city $state / $country |
The values are used as follows:
1 - Default, most countries except those below.
2 - USA
3 - Spain
4 - Singapore
5 - Germany
6 - UK/GB
7 - Australia
Still have questions? No problem! Just head over to the
Zen Cart support forum
and ask there in the appropriate subforum.
In your post, please include your Zen Cart and PHP versions, and a link to your site.
Is there an error or omission on this page? Please post to General Questions on the support forum. Or, if you'd like to open a pull request, just review the guidelines and get started.
You can even PR right here.
Last modified September 14, 2020 by Scott C Wilson (32f6c23).