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
Comment #1
danon1981 commentedFound 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?
Comment #2
danon1981 commentedAfter 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.
Comment #3
okokokok commentedI 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.
Comment #4
okokokok commentedI went for a solution based on the postal code.
Still think this is a valid feature request.
Comment #5
rszrama commentedComment #5.0
rszrama commentedExpended my question to make it more understandable and because I know realise it is more a feature request then a code problem.
Comment #6
WilliamV commentedSame problem here. I need to be able to add provinces for Belgium. Any update on this issue?
Comment #7
bojanz commentedAccording 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...
Comment #8
marcel.jtf commentedIt would have been a nice addition. The address_field is not always used for postal reasons.
Comment #9
BT2142 commentedI need this feature to! Anyone found out how to atleast be able to display the province for NL and BE ?
Comment #10
bojanz commentedBy implementing hook_addressfield_administrative_areas_alter() in a custom module and providing the provinces yourself.
Comment #11
summit commentedHi 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
Comment #12
bojanz commentedhook_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.
Comment #13
summit commentedHi, 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
Comment #14
summit commentedHi 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