Skip to content
Fluid Checkout
  • Demo
  • Features
  • Add-ons
    • Complete Bundle Save 42%
    • Fluid Checkout PRO
    • Google Address Autocomplete
    • Address Book
    • EU-VAT Assistant
  • Pricing PRO
  • Docs
  • Support
  • My account
0,00 € 0 items
Home / Docs / fc_gaa_google_autocomplete_js_settings

How can we help?

Getting started

  • Do I need to uninstall the free version when upgrading to PRO, or is Fluid Checkout Lite required?
  • Getting Started with Fluid Checkout
  • Getting started with Google Address Autocomplete
  • Translate Fluid Checkout plugins into your language

Features

  • Proof of address for sales of digital goods
  • Progress Bar Styles – checkout steps progress indicator
  • WooCommerce edit cart on checkout — change quantity or remove items from the cart directly at the checkout page
  • Trust symbols — add security badges, trust seals and other trust symbols to strategic places on the checkout, cart and order received pages
  • Order pay – optimized and intuitive design for your WooCommerce Order Pay page
  • Privacy compliance – Personal data erasers and exporters
  • Local Pickup — WooCommerce Local Pickup hide shipping address when local pickup is selected
  • International phone numbers — WooCommerce checkout phone number validation and formatting based on country rules
  • Express checkout — quick payment buttons for Google Pay, Apple Pay and other payment methods
  • Design templates — match your brand styles on the WooCommerce Checkout template
  • Billing address positions — choose to display billing address before shipping, inside the shipping step or force shipping and billing address to a single section
  • Account matching / user matching — associate purchases with and existing customer account without logging in

Customizations

  • Fix order summary and progress bar being cut off by the site’s header
  • Change the icon or icon color for the cart button on mobile
  • Move the “Phone” field to the contact step
  • Using Google Address Autocomplete on custom address fields and sections
  • Configure cart quantity fields for decimal quantities
  • Change fields copied from shipping address to billing address
  • Move first and last name fields to the contact step
  • Enable address autocomplete by zip code or post code
  • Customize Local Pickup location address and use multiple pickup locations
  • Customize button colors and other button styles
  • Customize colors of elements on Fluid Checkout
  • Customize template files for WooCommerce and Fluid Checkout
  • Customize checkout steps
  • Add custom house number field and make it required
  • Customize checkout fields and adding custom checkout fields
  • Safely add code snippets to your WooCommerce website

Compatibility

  • Compatibility with plugin WooCommerce Order Delivery
  • Compatibility with plugin WooCommerce Germanized
  • Compatibility with plugin YITH WooCommerce Cart Messages Premium
  • Compatibility with plugin Shipping Zones by Drawing
  • Compatibility with plugin Elementor
  • Compatibility with plugin MyParcel
  • Compatibility with theme The Gem
  • Compatibility with plugin WooCommerce Delivery Slots by Iconic
  • Compatibility with plugin Mailchimp for WooCommerce
  • Compatibility with plugin WooCommerce Checkout Manager By QuadLayers
  • Compatibility with plugin Breakdance
  • Compatibility with theme Pressmart
  • Compatibility with theme Divi and the Divi Builder
  • Compatibility with WooCommerce Block-based checkout and cart forms
  • Compatibility with theme Goya
  • Compatibility with theme Botiga
  • Compatibility with theme Atomion
  • Compatibility with theme OceanWP
  • Compatibility with plugin Digits
  • Compatibility with plugin Storefront Powerpack
  • Troubleshooting – jQuery events or vanilla JavaScript events not working
  • Compatibility with theme ZK Nito
  • Compatibility with Checkout Field Editor PRO by ThemeHigh
  • Compatibility with theme Woodmart
  • Compatibility with plugin “Plugin Organizer”

Troubleshooting

  • Troubleshooting – jQuery events or vanilla JavaScript events not working
  • Troubleshooting – Local pickup prevents customer from proving a shipping address, blocking other shipping methods
  • Troubleshooting – Redirected to error 404 (page not found) when trying to delete an address from the Address Book
  • Troubleshooting – Google Addresses Autocomplete not working despite following installation guide
  • Troubleshooting – Trust symbols widgets randomly moving to other areas when switching themes

Account & Purchases

  • Can I get a refund for my purchase?
  • Finding my invoice, adding billing details and VAT number
  • New versions updates are not appearing on my website

Development

  • Filter and action hooks – Fluid Checkout Lite
  • Filter and action hooks – Google Address Autocomplete
  • Filter and action hooks – EU-VAT Assistant
  • Changelog – Fluid Checkout EU-VAT Assistant
  • Troubleshooting – jQuery events or vanilla JavaScript events not working
  • Changelog – Fluid Checkout Address Book
  • Checking data returned from Google Address Autocomplete address search
  • Changelog – Google Address Autocomplete
  • Changelog format and semantic version numbers
  • Changelog – Fluid Checkout PRO & Lite
View Categories

fc_gaa_google_autocomplete_js_settings

Back to list of all filter and action hooks for Google Address Autocomplete.

Description #

Modify the Google Autocomplete frontend script settings. Often used to modify the mapping of the checkout fields to the data returned by the Google APIs.

Parameters #

  • $settings (array) The Google Address Autocomplete settings array. Usually contains the following values:
    • debugMode (bool) Whether debug mode is enabled.
    • autocompleteDefaultOptions (array) Default options for the Places Autocomplete API settings object.
      • includedPrimaryTypes (array) Result types allowed to be returned for address autocomplete fields. Not used for company fields as specific types are configured for them. See accepted values on Places API documentation.
    • companyAutocompleteInputEnabled (string) Whether autocomplete by company name is enabled. Accepts yes or no.
    • companyAutocompleteValueEnabled (string) Whether autofill of the company field from address suggestions is enabled. Accepts yes or no.
    • companyAutocompleteTypes (array) Result types allowed to be returned for company autocomplete. See accepted values on Places API documentation.
    • autocompleteInputSelector (string) CSS selector for autocomplete input fields. Used to target custom fields and enable autocomplete suggestions for them.
    • companyAutocompleteInputSelector (string) CSS selector for company autocomplete input fields.
    • addressFieldsSelector (string) CSS selector for address fields.
    • localeComponents (array) Field mapping for different locales.
    • valueMapping (array) Value mapping to correctly match values returned by the Google Places API to the expected values accepted by WooCommerce.
    • useFieldDescriptionForInstructions (string) Whether to use field descriptions for instructions. Accepts yes or no.

The locationComponents array consists of nested arrays of the field mappings for each locale. The array key is the country code or default for the default mappings, and the array values are the mappings.

For each locale components mapping, the following items can be expected, and the values are either a string or an array with the component names from the Google Places API:

  • country_name (string) Places API component name for the country name.
  • country (string) Places API component name for the country code.
  • postcode (string) Places API component name for the postcode field.
  • state (string) Places API component name for the state field.
  • city (string) Places API component name for the city field.
  • fallback_city (string) Fallback Places API component name for the city field, used in case the component set for the city field is missing in the returned data.
  • address_1 (string|array) Places API component name for the street address field. Will usually be an array with the various components that map to the street address field.
  • components_separator (string) The string used to separate components when multiple values are used for one field (for instance for the street address field). Defaults to one empty space .
  • subpremise_separator_position (string) The position where the subpremise component separator string should be added. Defaults to after, and also accepts before.
  • subpremise_separator_before (string) The string used to separate the subpremise components before its value where subpremise is used. Defaults to empty string, no separator added.
  • subpremise_separator_after (string) The string used to separate the subpremise components after its value where subpremise is used. Defaults to /.

Examples #

/**
 * Change the `localeComponents` settings to fill custom house number fields.
 * 
 * @param   array  $settings  JS settings object of the plugin.
 */
function fcgaa_change_locale_mapping_house_number( $settings ) {
    // New locale components to merge
    $new_locale_components = array(
        'default' => array(
            'address_1' => array( 'route' ),
            'house_number' => array( 'street_number' ),
            'components_separator' => ', ',
        ),
        // Example to set changes to specific countries only
        // 'US' => array(
        //      'address_1' => array( 'route' ),
        //      'house_number' => array( 'street_number' ),
        //      'components_separator' => ', ',
        // ),
    );

    foreach ( $new_locale_components as $locale_key => $locale_settings ) {
        // Create locale settings if not existent
        if ( ! array_key_exists( $locale_key, $settings[ 'localeComponents' ] ) ) { $settings[ 'localeComponents' ][ $locale_key ] = array(); }

        // Merge settings
        $settings[ 'localeComponents' ][ $locale_key ] = array_merge( $settings[ 'localeComponents' ][ $locale_key ], $locale_settings );
    }

    return $settings;
}
add_filter( 'fc_gaa_google_autocomplete_js_settings', 'fcgaa_change_locale_mapping_house_number', 10 );
Still stuck? How can we help?

How can we help?

Updated on September 5, 2025
Table of Contents
  • Description
  • Parameters
  • Examples
Fluid Checkout

Frictionless Multi-step Checkout for WooCommerce

© 2021-2025 Fluid Checkout OÜ

Terms | Refunds | Privacy Policy | Cookies

Products
  • All products
  • Fluid Checkout PRO
  • Fluid Checkout Lite
  • Google Address Autocomplete add-on
  • Address Book add-on
  • EU-VAT Assistant add-on
Company
  • Support
  • Careers Hiring
  • My account
  • About
  • Homepage
  • Homepage
  • Features
  • Pricing PRO
  • Demo
  • Docs
  • Support
  • My account