Closed (fixed)
Project:
Address field for CCK
Version:
5.x-1.0
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
21 Mar 2007 at 22:08 UTC
Updated:
25 Apr 2007 at 23:45 UTC
Request for support of Canadian addresses in module "Address field for CCK".
I looked at the official CanadaPost guide and for civic addresses found the following components:
Here's an example address:
JOHN JONES
MARKETING DEPT(1)
10(2)-123(3) 1/2(4) MAIN(5) ST(6) NW(7)
MONTREAL(8) QC(9) H3Z 2Y7(10)
I would say this requires at least five fields in database:
Comments
Comment #1
sshvetsov commentedThere are also other address types like Post Office Box Addresses, Rural Route Addresses, General Delivery Addresses and Military Addresses. Those have their own requirements, but could be accommodated with two more fields, additional information and second street address (or something like that).
Also, here's link to goty details on Canada's Addressing Guidelines: http://www.canadapost.ca/tools/pg/manual/PGaddress-e.asp#1383575
Comment #2
rconstantine commentedSo it sound like there are almost enough fields now:
U.S. Canada
street1 street address
street2 second street address
apartment/suite unit number
city municipality
state province
zip postal code
country country
The only thing that isn't there is your 'additional information' field. When I get a chance, I'll put together a template for state/province install-include files and a layout for Canadian addresses. Feel free to beat me to it. I'll also figure out a country selector of some kind.
Comment #3
sshvetsov commentedHere's a list of provinces/territories and the official abriviations:
Alberta, AB
British Columbia, BC
Manitoba, MB
New Brunswick, NB
Newfoundland and Labrador, NL
Northwest Territories, NT
Nova Scotia, NS
Nunavut, NU
Ontario, ON
Prince Edward Island, PE
Québec, QC
Saskatchewan, SK
Yukon, YT
Comment #4
sshvetsov commentedSorry, can't help much with code, but will definitely provide data and testing results.
Comment #5
ray007 commentedIf different countries have very different address fields, we should probably only have the common fields as rows in the database and add a column "data" to hold a serialized array with country-specific data.
If I look at canadian addresses, the civic data and the street direction may be candidates for the data-field, maybe unit number, ... ?
Comment #6
sshvetsov commentedOr it could be a good idea to have a separate table for every country. That way all address information could be as detailed or as general as required. The problem is how would you let user/administrator choose what country's address form is displayed and form processing for every country would have to be different.
Comment #7
rconstantine commentedJust thought I'd let you know I started on this.
Comment #8
rconstantine commentedI think I've added what you need. The new release should show up within 12 hours (drupal's cron job). One thing I wasn't sure about is what was needed besides the province info. So if I left something out, open another issue regarding that specifically.
If anyone doesn't like the way the fields are presented, you could write a cck widget to make it look how you'd like. Or you can theme it differently.
Comment #9
(not verified) commented