Autocomplete Address and Location Picker for WooCommerce Premium

⌘K
  1. Home
  2. Docs
  3. Autocomplete Address and ...
  4. Getting Started
  5. General Settings

General Settings

This guide explains every setting inside the Autocomplete Address & Location Picker for WooCommerce plugin. Follow it to configure Google Maps, autocomplete, map picker, customer location, and all advanced features.

πŸ”‘ Google API Key Setup

Google Maps requires an API key with billing enabled.
This key powers:

  • Address autocomplete
  • Map display
  • Location picker
  • Reverse geocoding
  • Customer location detection

Follow the steps below to generate and configure your Google API key.

βœ” Step 1: Enable Billing

Before anything else, billing must be active.

Go to:
https://console.cloud.google.com/project/_/billing/enable

Select or create a project and enable billing.

βœ” Step 2: Create or Select a Google Cloud Project

  1. Go to: https://console.cloud.google.com/
  2. Click the project selector.
  3. Choose New Project or select an existing one.
  4. Name your project (e.g., β€œmywebsite.com”).

βœ” Step 3: Enable Required APIs

Navigate to: APIs & Services β†’ Library

Enable these APIs:

Required:

  • Places API (New)
  • Maps JavaScript API
  • Geocoding API
  • Maps Embed API

Note for existing users:

If your Google Cloud account is older, you may also see:

  • Places API (Legacy)

This is normal. Keep reading for guidance.

βœ” Step 4: Create an API Key

  1. Go to APIs & Services β†’ Credentials
  2. Click Create Credentials β†’ API Key
  3. A popup will show your key
  4. Click Restrict Key

βœ” Step 5: Restrict the API Key (High Security)

Application Restrictions:

Select: HTTP referrers (web sites)

Add the following formats:

https://example.com/*
http://example.com/*
example.com/*
*.example.com/*

API Restrictions:

Select: Restrict key

Enable:

  • Places API (New) ← recommended
  • Maps JavaScript API
  • Geocoding API
  • Maps Embed API

Click Save.

βœ” Step 6: Add the API Key to Your Plugin

In WordPress β†’ WooCommerce β†’ Settings β†’ Autocomplete Address
Paste your API key into:

Google API key

Save changes.

πŸ”§ Google API Type β€” (NEW vs LEGACY)

Google now provides two versions of the Places API:

  • Places API (New) – Recommended
  • Places API (Legacy)

Which one should you select?

⭐ New Users (2025 and forward)

βœ” Select: Places API (New)

This is the version Google now recommends for all new API projects.

It provides:

  • Faster autocomplete
  • Better accuracy
  • Updated structured address data
  • Improved session token handling
  • Modernized endpoint: places.googleapis.com

If you created your Google project recently, always choose this option.

⭐ Existing Users (Older Google Cloud Projects)

If your project was created years ago, you may see both APIs:

  • Places API (New)
  • Places API (Legacy)

This is normal.

Google keeps both APIs available to maintain compatibility during migration.

Which one should you choose?

Option A – Choose Places API (New)

If:

  • Your autocomplete works correctly with it
  • You want faster performance
  • You want the most future-proof option

Option B – Choose Legacy

If:

  • Your existing API calls were built on the Legacy version
  • Switching to “New” causes errors
  • Your autocomplete suddenly stops working with “New”

The plugin fully supports both versions – choose whichever works best with your Google Cloud account.

βš™οΈ Billing & Shipping Address Autocomplete

Enable autocomplete separately for:

  • Billing Address
  • Shipping Address

When enabled, Google address suggestions appear as the user types.

🌍 Country Restrictions

Limit autocomplete suggestions to specific countries.

  • You may select up to 5 countries.
  • This improves accuracy and reduces irrelevant suggestions.

Example:
USA, Canada, UK, Germany.

🏠 Address Format

Choose how addresses should be inserted into WooCommerce fields:

  • Number + Street Name
  • Street Name + Number

Pick the format appropriate for your region.

πŸ—ΊοΈ Map Settings

Enable the map to show an interactive Google Map at checkout.

βœ” Enable Map

Turns on the map display.

βœ” Map Zoom

Controls how close the map appears (0–22).
Recommended: 17–19 for cities.

βœ” Center Map

Set default map center with latitude + longitude.

How to get coordinates:
Right-click on any location in Google Maps β†’ β€œWhat’s here?”

πŸ“ Map Position

Choose where the map appears:

  • Before address fields (recommended)
  • After address fields

πŸ“Œ Location Picker (Drag the Pin)

When enabled, customers can:

  • Drag a pin on the map
  • Automatically update the address fields
  • Provide exact delivery coordinates

Location Picker Options:

  • Update address only
  • Update coordinates only
  • Update address and coordinates ← recommended

This ensures the address is accurate AND GPS-precise.

πŸ“‘ Coordinates in Orders

Enable this to save:

  • Latitude
  • Longitude
  • A clickable β€œView on Google Maps” link

Great for:

  • Delivery drivers
  • Dispatching apps
  • Route optimization
  • Couriers and restaurants

Coordinates appear in:

  • Admin order details
  • Email notifications (optional)
  • Driver apps that integrate with WooCommerce

πŸ“ Customer Location (GPS Auto-Detect)

Two options:

βœ” Enable β€œUse customer’s current location” button

Adds a button customers can tap to auto-fill their exact location.

βœ” Auto-select customer location

Automatically attempts to detect location on checkout load.

Works best on mobile devices with GPS.

🐞 Debug Logging

Enable this only when debugging.
It prints logs to browser console:

  • API responses
  • Address components
  • Map errors
  • JS execution steps

Do not leave enabled on production unless needed.

⚠️ Important Notes About Caching & Optimization

Google Maps will NOT load if your site:

  • Caches the checkout page
  • Combines JavaScript files
  • Defers JavaScript
  • Minifies external Google scripts
  • Uses Cloudflare Rocket Loader
  • Uses aggressive performance plugins

Make sure to:

  • Disable caching on /checkout page
  • Exclude Google Maps scripts from minification
  • Disable combine/minify/defer JS on checkout
  • Exclude checkout from Cloudflare HTML caching

πŸŽ‰ Your Setup Is Complete!

You are now fully configured with:

  • Google Places API (New)
  • Autocomplete for WooCommerce
  • Map-based location picker
  • GPS customer location
  • Accurate coordinates saved to orders
  • Full API restriction security