Others

Auto Address Search Service

10min

Overview & Purpose:

The Google auto address search service, suggests several addresses i.e. when a customer/user starts typing address, autocomplete /auto-suggest will fill the rest.

The Address fields system will give auto-suggestion for the fields using the Google APIs, just like the way the browser gives suggestions to fill in details. However, a customer will have the liberty to ignore the provided suggestion and enter their own address details.

This auto address search functionality will be available on User Registration Page, Guest Checkout Page, Shipping Address Page and manage Address on Cart section:

Document image


How to integrate:

This article walks you through the steps to set up the Google Auto-Address Search Feature –

1. Create a New Project

Visit Google's Developer Console and login with your Google Account. After a successful login, create a New Project from a CREATE PROJECT Button.

  • Enter your Project Name and Location to create a New Project.
  • You can also use an existing project rather than creating a new one.

2. Enable Places API

After creating the project, the page will redirect you to your project dashboard. Click on the ENABLE APIS AND SERVICES button.

  • In the API Library, search Maps JavaScript API in the search bar and select the same:
Document image

  • Click on the Enable.

3. Enable Maps JavaScript API

Similarly, enable the Places API:

Document image


4. Get an API Key

To use the Places API, you must have an API key.

  • For this click the menu button and navigate to APIs & Services >> Credentials:
Document image

  • On the Credentials page, click on the + CREATE CREDENTIALS button and then select API key from the drop-down.
  • The API Key will be generated in the pop-up. Click on the Close button.

To restrict the API key

  • Click on the exclamation icon on the API Key (as shown in the picture):
Document image

  • In the Edit Settings page, find the API Restrictions section and restrict the key for Maps JavaScript API and Places API:
Document image

  • Click on the Save.

5. Configuration into Admin Panel

Admin can enable the setting from the Admin >> Store Configuration >> Shipping Method >> ‘Shipping Address Setting’ button (top right corner) >> Auto Address Search Service:

Document image

  • Select that where Customer will get, the auto-suggestion option – it can be Address Line 1, Address Line 2, City, Zip Code, Company Name.
  • According to the select field, customers will get auto suggestions.