I had a bit of trouble rolling a patch but have attached the two main files for NZ address format support.

Place in includes and theme, also need the patch to .info and default_mappings to complete the integration.

Thanks for the useful module,

DT

P.S. rename extension to .tar.gz to extract.

CommentFileSizeAuthor
addressfield--nz.tar_.gz1.03 KBdavidwhthomas

Comments

davidwhthomas’s picture

Re: additional changes to the .info and .module files

addressfield.info file needs

files[] = includes/addressfield_form_nz.inc

addressfield.module file needs:

<?php
/**
 * Default mapping of address forms to countries.
 */
function addressfield_default_mapping() {
  return array(
    'default' => 'AddressFieldForm_default',
    'BR' => 'AddressFieldForm_br',
    'GB' => 'AddressFieldForm_gb',
    'US' => 'AddressFieldForm_us',
    'NZ' => 'AddressFieldForm_nz', // add this line
    // TODO: complete the mapping.
  );
}
?>

Best to add the first .info line when the file is in place, clear 'class registry' cache and then add the second .module patch, to avoid a class not found error.

cheers,

DT

damien tournoud’s picture

Status: Needs review » Closed (won't fix)

The -reloaded branch has been merged. It comes with reasonable defaults for most countries in the world, including New Zealand. It can be extended in contrib to provide the province dropdown.

babbage’s picture

Category: feature » bug
Status: Closed (won't fix) » Closed (duplicate)

The defaults are not reasonable for New Zealand when they have a required field for "State" and there are no states in New Zealand. Even the concept of regions here is pretty tenuous, and certainly never a required field in an address. A year on, a patch is in #1651612: Add administrative area #options for New Zealand regions. This is a bug so it does not seem reasonable to push this to contrib.

davidwhthomas’s picture

Agreed, this post was made a while ago and things have changed since then. it was meant as a starting point but I'm happy to move on as am using a custom addressfield ctools plugin instead which works fine.
DT