Created: 18/03/2014
By: Virginie Garcin – MB Création
Email: support@mbcreation.net
Thank you for purchasing Google Address Autocomplete for Woocommerce. If you have any questions that are beyond the scope of this help file, please feel free to email via my user page contact form here. Thanks so much!
Google Address Autocomplete for Woocommerce simplify the checkout process, helping the customer to enter his address with the Google Places suggest.
Google Address Autocomplete for Woocommerce requires WordPress 3.8+ (may work on older version but has not been tested) and WooCommerce 2.0 or 2.1.
Just like every plugin, just copy the woocommerce-google-address folder in your wp-content/plugins folder then activate it through WordPress dashboard.
If the installation went OK, the plugin is directly available on the checkout page of your site.
If you encounter issue with the Google Map Api (in your browser console) it could be a good idea to register your website on the google map website and register it to get an official API Key (totally free). Visit this website (https://developers.google.com/maps/documentation/javascript/get-api-key#key) to register your url and obtain a "browser key". Then add it to your website : WooCommerce general settings section > Google Adresse Autocomplete.
Nine filters are availables for developpers to manipulate default behaviour of the plugin :
Disable the inclusion of the default css
// functions.php of the theme folder add_filter('woogoogad_use_css_filter', '__return_false');
Changing the order of the fields inside the grouped fields for billing address (putting country first)
// functions.php of the theme folder function my_theme_woogoogad_billing_fields_to_group_filter($array) { return array('billing_country', 'billing_address_1', 'billing_address_2', 'billing_city', 'billing_state', 'billing_postcode'); } add_filter('woogoogad_billing_fields_to_group_filter', 'my_theme_woogoogad_billing_fields_to_group_filter');
Adding a custom (but already defined) shipping_address_3 to the grouped fields for shipping address
// functions.php of the theme folder function my_theme_woogoogad_shipping_fields_to_group_filter($array) { array('shipping_address_1', 'shipping_address_2' , 'shipping_address_3', 'shipping_city', 'shipping_state', 'shipping_postcode', 'shipping_country'); } add_filter('woogoogad_shipping_fields_to_group_filter', 'my_theme_woogoogad_shipping_fields_to_group_filter');
Renaming the 'address not found ?' link in the billing form
// functions.php of the theme folder function my_theme_woogoogad_billing_address_not_found_label_filter($label) { return 'My new label'; } add_filter('woogoogad_billing_address_not_found_label_filter', 'my_theme_woogoogad_billing_address_not_found_label_filter');
Putting name and email after the address in the billing form
// functions.php of the theme folder function woogoogad_billing_fields_to_put_after_address($fields) { $fields[] = 'billing_email_field'; $fields[] = 'billing_phone_field'; return $fields; } add_filter('woogoogad_billing_fields_to_put_after_address_filter', 'woogoogad_billing_fields_to_put_after_address');
Putting company name after the address in the shipping form
// functions.php of the theme folder function woogoogad_shipping_fields_to_put_after_address($fields) { $fields[] = 'shipping_company_field'; return $fields; } add_filter('woogoogad_shipping_fields_to_put_after_address_filter', 'woogoogad_shipping_fields_to_put_after_address');
Hide address fields for returning customers
// functions.php of the theme folder function woogoogad_hide_address_fields_for_returning_customers($val) { return true; } add_filter('woogoogad_hide_address_fields_for_returning_customers_filter', 'woogoogad_hide_address_fields_for_returning_customers');
Virginie Garcin – MB Création