Back to list of all filter and action hooks for Google Address Autocomplete.
Description #
Modify the Brasil API integration settings for address autocomplete functionality.
Parameters #
$settings
(array) The Brasil API settings array containing:debugMode
(bool) Whether debug mode is enabledbrasilApiURL
(string) The Brasil API URL template for CEP lookuplocaleComponents
(array) Field mapping for address components. The array key is the address field ID on the checkout form, and the array value is the field ID on the data returned by the API:state
(string) State field ID from the returned data.city
(string) City field ID from the returned data.address_1
(string) Street address field ID from the returned data.neighborhood
(string) Neighborhood field ID from the returned data.
Examples #
/**
* Modify Brasil API settings field mappings.
*/
function modify_brasil_api_settings( $settings ) {
// Field mappings
$settings['localeComponents'] = array(
'state' => 'state',
'city' => 'city',
'address_1' => 'street',
'neighborhood' => 'neighborhood',
);
return $settings;
}
add_filter( 'fc_gaa_brasil_api_autocomplete_js_settings', 'modify_brasil_api_settings', 10 );