When using the address field for addresses form the Netherlands and Belgium there is no state/province field supplied.

I tested if it would be the case for United States witch works, the state field is supplied when the US is selected. So the module seems to be functioning fine but has not/is not able to retrieve the Dutch and Belgium provinces.

Because in my use case taxonomy terms need to be retrieved from the address field I am returned with an "unknown" state/province term because this is not needed for normal address display.

What action can be taken to supply the province on address fields for Ducth and Belgian websites, and can I be of help to provide the needed information to do so?

I think it should be optional to be able to select a province to suite different use cases for the address field.

Comments

danon1981’s picture

Found the appropriate file "sites/all/modules/addresfield/format/plugins/address.inc" so I'm able to provide the needed provinces. Here I am able to add my required provinces for the countries mentioned above.

*How can I contribute the changes I'm making so these can be in a future release of address field to make the out of the box module more complete. Should I try (would be first time) to write a patch?

danon1981’s picture

Category: support » feature
Status: Active » Closed (works as designed)

After looking into the module more closely I see my suggestion above is not inside the focus of the module. I need to explain that I ran into the requirement of using province for the mentioned countries because of the dependency for use in combination for openlayers and next to that the use of taxonomized location data.

Because the location fields are not compatible to geocode from I turned to address field and then ran into the issue of not being able to require the province for the mentioned countries.

Therefore I guess I should have labelled this as a feature request or better yet should submit a feature request to make location module and geocoding work together.

okokokok’s picture

Status: Closed (works as designed) » Active

I want to use the client's province to determine shipping costs.
I am really surprised it's not possible to simply enable the province field for BE/NL.

I would like to be able to either derive the province from the postcode or to have it as a user provided field.

okokokok’s picture

Title: State/province field not displayed for the Netherlands and Belgium » State/province field not displayed or available for the Netherlands and Belgium

I went for a solution based on the postal code.

Still think this is a valid feature request.

rszrama’s picture

Component: Code » Address formats
rszrama’s picture

Issue summary: View changes

Expended my question to make it more understandable and because I know realise it is more a feature request then a code problem.

WilliamV’s picture

Issue summary: View changes

Same problem here. I need to be able to add provinces for Belgium. Any update on this issue?

bojanz’s picture

Status: Active » Closed (won't fix)

According to the Universal Postal Union, and Google's dataset, neither Belgium nor Netherlands use the provinces for addressing (a postal address should not contain a province field). Therefore, adding them to the module is out of scope. You can write a module that provides a custom plugin with the desired data.

http://www.upu.int/fileadmin/documentsFiles/activities/addressingUnit/be...
http://www.upu.int/fileadmin/documentsFiles/activities/addressingUnit/nl...

marcel.jtf’s picture

It would have been a nice addition. The address_field is not always used for postal reasons.

BT2142’s picture

I need this feature to! Anyone found out how to atleast be able to display the province for NL and BE ?

bojanz’s picture

By implementing hook_addressfield_administrative_areas_alter() in a custom module and providing the provinces yourself.

summit’s picture

Hi Bojanz,
I would like the same for a lot of European Countries.
I had location module in D6, but want to go to Addressfield module in D7. I have all the migration working..but now I am missing province field.
Could you give me a headstart how to proceed to get this done for say France and Germany, the biggest countries I use. Could I use somehow the same sort of technique as location did?

greetings, Martijn

bojanz’s picture

hook_addressfield_address_formats_alter() to add administrative_area to the used fields for FR and DE, then hook_addressfield_administrative_areas_alter() to provide those administrative areas.

summit’s picture

Hi, I see this answer here: http://drupal.stackexchange.com/questions/95260/drupal7-addressfield-mod...
Is this old information. Should it now be done like you say?

greetings, Martijn

summit’s picture

Hi Bojans, could I make a custom module but such that improvements are also available
like https://www.drupal.org/node/2421211#comment-10232691 (to be able to show the name in view instead of the code for administrative area)
Greetings, Martijn