It may be a stupid question: What is the path to add a new country customization?

I want regions (states) from my country (Romania) to be selectable from a select dropdown and other changes and validations.

Should I create a patch against plugins/format/address.inc? And add there...

  else if ($address['country'] == 'RO') {
    $format['locality_block']['administrative_area']['#options'] = array(
    ...

Ughh... Ugly!

I saw the CH example... and I'm confused more now. Patching module or implementing a plugin? Or?

Comments

damien tournoud’s picture

Status: Active » Fixed

The way forward for administrative sub-divisions is #1317070: Use ISO codes XML file for populating country-specific properties.

claudiu.cristea’s picture

Status: Fixed » Active

Sorry... still don't get it. It's not implemented yet? Or? I saw that XML... where does it comes in? The only point where I saw sub-divisions was the (ugly) hardcoded address.inc.

This is not "fixed". We need to document a way to implement, not only subdivisions, but also postal codes validations, etc.

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.

rszrama’s picture

Status: Active » Closed (duplicate)

Basically, there is no path, that's what Damien was trying to communicate. j0rd's issue is the issue where a complete solution will ultimately be implemented, so I recommend following along there.

rszrama’s picture

Issue summary: View changes

Updated issue summary.