Google Maps and Places API Key
A single Google API key controls two features:
The address map shown on the Addresses order page in the admin (Maps JavaScript API). Available in all recent AbanteCart versions.
Google Places address autocomplete in storefront address forms.
1. Create a Google Cloud project and API key
Sign in to the Google Cloud Console.
Create a new project or select an existing one.
Open APIs & Services → Library and enable both APIs that the AbanteCart key needs:
Maps JavaScript API — used for the admin order-page map.
Places API — used for storefront address autocomplete.
Open APIs & Services → Credentials, click Create credentials → API key, and copy the new key.
Detailed Google walkthroughs: Set up the Places API.
2. Restrict the key
The key is loaded on storefront pages and is therefore exposed in the user's browser. Restrict it before going live.
On the same Credentials page, open the key and set:
Application restrictions → Websites — add your storefront for example
*.example.com. Add additional domains for multistore or staging environments.API restrictions → Restrict key — limit the key to Maps JavaScript API and Places API.
Save the changes. Restrictions can take a few minutes to propagate.
3. Add the key in AbanteCart
In the AbanteCart admin, go to System → Settings → General.
Paste the key into the Google Maps and Places API Key field.
To turn on storefront checkout autocomplete (requires AbanteCart 1.4.4 or later), set Address Autocomplete (Google Places) to Yes.
Save the settings.
4. Verify
Admin map: open any order in the admin and confirm the shipping address renders on the embedded map.
Storefront autocomplete: on the default theme or Novator, start typing an address during checkout. Suggestions per selected country should appear after a few characters. If they don't, see Troubleshooting below.
Troubleshooting
Symptom | Likely cause and fix |
|---|---|
"For development purposes only" watermark on the map | Billing is not enabled on the Google Cloud project. Enable a billing account in the Cloud Console. |
| Wrong or empty key in System → Settings → General → Google Maps and Places API Key. Re-copy the key from Google Cloud Console. |
| The current domain is not listed under Application restrictions → Websites on the key. Add the storefront and admin URLs. |
Autocomplete suggestions never appear | The Places API is not enabled on the key, or API restrictions exclude the Places API. Also confirm Address Autocomplete (Google Places) is set to Yes in AbanteCart General settings. |
Autocomplete works in admin testing but not on the live theme | Confirm the storefront theme is the default theme or Novator on AbanteCart 1.4.4 or later. Custom themes need to include the address autocomplete script hook in their address templates. |
Related
Google reCAPTCHA (separate key, different APIs)