Configure Address Autocomplete for Storefront Next

Address autocomplete streamlines checkout in Storefront Next for B2C Commerce. During checkout, shoppers can enter the first three characters of their shipping or billing address to instantly receive Google-powered recommendations. When a shopper selects an address from the list of recommendations, Google completes the remaining fields.

Checkout by using address autocomplete.

On production instances, address autocomplete uses a Salesforce-provided platform API Key by default, so no additional API Key setup is required.

On non-production environments, such as on-demand sandboxes (ODS), development, and staging instances, you must set up and use your own API Key. Set up your own Google Cloud Platform (GCP) project and billing, and your own API Key for the Google Maps Platform. Then, input the API Key as a new PUBLIC__app__features__googleCloudAPI__apiKey environment variable in your Managed Runtime (MRT) project. See Getting started with Google Maps Platform and Environment Variables. You can also configure a custom API Key on production instances if you don’t want to use the Salesforce-provided platform API Key.

  1. Set up Storefront Next.

    To create a storefront with a GitHub repository, see Create a Storefront in Business Manager with a GitHub Repository. To create a storefront with local code, see Create a Storefront in Business Manager with Local Code.

  2. (Required only for production instances) To allow the Google API key to become available in Storefront Next, update the hostnames in your alias file.

    a. In Business Manager, click App Launcher, and then select Merchant Tools | Site | SEO | Aliases.

    b. Specify your hostnames in the alias file, and then save your changes.

    If you’ve already specified your hostnames in the alias file, save the file again for the Google API key to become available.

    Important

    See Hostname Aliases, Configure a Hostname Alias, and Configure MRT Routing Rules in Business Manager.