How can I autofill checkout of Woocommerce with Google place API?

942 Views Asked by At

I have activated an API Key from "Google Places API Web Service" following all the instrutions.

Now I'm trying to use this API to autocomplete billing form of Woocommerce like this demo:

https://developers.google.com/maps/documentation/javascript/examples/places-autocomplete-addressform.

How can I adapt this code in my form?

Do I need to edit only ID or other?

Thanks very much for the answers!

PS: The API KEY works with Google's demo.

edit: I have made a new field like the google demo fot the autocomplete and edited the Id. It's working for the simple field, but not for COUNTRY and STATE because they are select fields.

How can I set up COUNTRY AND STATE?

I can have the returning value "US" In woocommerce I have Stati Uniti (US)

0

There are 0 best solutions below