I want to select automatically the state and city according to a zipcode in the billing information process bar of one page checkout.
Asked
Active
Viewed 1,528 times
0
-
http://stackoverflow.com/questions/12553160/getting-visitors-country-from-their-ip – Dushyant Joshi Apr 02 '15 at 08:15
1 Answers
2
Use GeoCoding APIs.
For example if you want result for zip 10017
http://maps.googleapis.com/maps/api/geocode/json?address=10017+US&sensor=true
Here we are passing ZIP code + Country. Reason is, some of the zip code returns more than one result. For example - 208006.
Thanks.

aforankur
- 1,291
- 1
- 15
- 27
-
-
1You can use Ajax functionality. Either you add a button beside ZIP code field and fire ajax to get the JSON response from Google or you can fire on 'onkeyup' or 'onblur' as per you requirement. Thanks. – aforankur Apr 02 '15 at 08:42
-
-