Hi, this is a great module. Thanks.

please include in address.inc a section for mexico states list. I have the code here

else if ($address['country'] == 'MX') {
$format['locality_block']['administrative_area']['#options'] = array(
'' => t('--'),
'AG' => 'Aguascalientes',
'BC' => 'Baja California',
'BS' => 'Baja California Sur',
'CM' => 'Campeche',
'CS' => 'Chiapas',
'CH' => 'Chihuahua',
'CO' => 'Coahuila',
'CL' => 'Colima',
'DF' => 'Distrito Federal',
'DG' => 'Durango',
'GT' => 'Guanajuato',
'GR' => 'Guerrero',
'HG' => 'Hidalgo',
'JA' => 'Jalisco',
'ME' => 'Estado de México',
'MI' => 'Michoacán',
'MO' => 'Morelos',
'NA' => 'Nayarit',
'NL' => 'Nuevo León',
'OA' => 'Oaxaca',
'PB' => 'Puebla',
'QE' => 'Queretaro',
'QR' => 'Quintana Roo',
'SL' => 'San Luis Potosí',
'SI' => 'Sinaloa',
'SO' => 'Sonora',
'TB' => 'Tabasco',
'TM' => 'Tamaulipas',
'VE' => 'Veracruz',
'YU' => 'Yucatán',
'ZA' => 'Zacatecas',
);
$format['locality_block']['administrative_area']['#title'] = t('Province');
}

Comments

j0rd’s picture

Issue tags: +pluggable regions

This is a duplicate of
#1829900: [meta] Address Field 2.x needs pluggable administrative areas and an actual API

If you think so to, please close your ticket.

papirrin’s picture

If somebody wants to add "Delegación o Municipio" to a México's address, simply add:

$format['locality_block']['sub_administrative_area'] =
array(
'#title' => 'Delegación o Municipio',
'#required' => TRUE,
'#weight' => 0,
'#size' => 22,
'#prefix' => '',
'#tag' => 'div',
);

only beware if you are in a multilingual site, you should set the title: '#title' => 'However you want to call Delegacion in english',

rszrama’s picture

Component: Code » Address formats
bojanz’s picture

Title: Include Mexico States list (included) » Add Mexican states
Version: 7.x-1.0-beta2 » 7.x-1.x-dev
Issue summary: View changes
bojanz’s picture

Status: Active » Fixed

Pushed a list with the proper ISO codes, and including the missing Tlaxcala.

  • bojanz committed b2219eb on 7.x-1.x
    Issue #1472628: Add Mexican States
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.