Why does the plugin do not show address autocomplete suggestions from zip code or post code by default? #
Entering the “Zip code” in the “Street address” field doesn’t feel natural to the users. From a User Experience point of view and because of the label of the form fields, users will tend to start typing their desired street address and will be presented with address suggestions to select from.
Moreover, users might confuse the first numbers presented in the address suggestions as being the “Zip code” when, in fact, the Google Places API returns them as the “house number”, or vice versa.
For those reasons, only “Precise addresses” will be returned by default for the address suggestion results. This ensures the suggestions presented contain all information for that address, including the “Zip code” and the “house number” when the data is available.
There are some cases when it is desirable to allow users to search for “Zip code” as in that country or culture, the “Zip code” is usually the first address information the user is asked to fill in.
Enable address autocomplete suggestions from zip code or post code #
Since version 1.0.1, it is possible to change the types of search results returned by the Google Places API from the plugin settings.
To enable search by “Zip code”:
- Visit the plugin settings page at WP Admin > WooCommerce > Settings > Integrations > Google Address Autocomplete.
- Change the option selected for the field “Results types” to “Geocode, except businesses (geocode)”.
- Save the changes.
Please note that enabling search by “Zip code” does not enable the Zip code field as an autocomplete field, this means that the customer will have to type the Zip code in the Street address field to see the address suggestions based on the Zip code.
Using the “Postcode / ZIP” field to automatically autocomplete other fields is only available for Brazilian addresses, and if the option “Enable Brasil API Address Autocomplete for CEP fields” is enabled.
Important: Please note that, due to limitations of the Google Places API, changing the type of search results may or may not work to enable search by zip code in your country or region.
Types of search results supported #
The types of search results available from the plugin settings are the same as the support types of the Google Places API, except for the combination of `geocode`
plus `establishment`
, which in practice is the same as allowing “All types”.
Visit the Google Places API documentation for more information about the supported types.