GazChap's WooCommerce GetAddress.io Postcode Lookup Wordpress Plugin - Rating, Reviews, Demo & Download
Plugin Description
This plugin enables your customers to complete their billing/shipping addresses by entering their postcode and selecting their address from the options given.
It utilises getAddress.io (https://getaddress.io) to do the lookup using their Royal Mail Postcode Address File.
An API key is required for the integration to work, and the integration only appears when the customer has selected United Kingdom (or, more specifically, the ISO-3166-2 code “GB”) for their country.
It can optionally be turned off for the shipping or billing addresses, and can be enabled or disabled in each of the checkout, customer account and WooCommerce admin screens.
Postcodes that are looked up are saved in a custom database table for 24 hours to help reduce your costs for use of the getAddress.io API.
Requirements
WooCommerce, at least version 3.0.
getAddress.io API Key. A number of pricing plans are available.
Note: Currently, this plugin does NOT support WooCommerce Checkout Blocks introduced as the default checkout experience in WooCommerce version 8.3, it can only be used with the WooCommerce checkout shortcode. I aim to make this plugin compatible with Checkout Blocks as soon as possible.
Usage
Once installed and activated, you need to go to the WooCommerce -> Settings -> General page in the WordPress dashboard. You can enter your API key and set your other options here.
Conflicts with other plugins
Certain plugins that also modify checkout fields can conflict with this plugin and prevent it from working.
Usually, the symptom of this is that the “Find Address” button does not appear.
Since version 2.1, I’ve added a Hook Priority setting at the bottom of the settings for the plugin that you can use to try and fix these conflicts.
The default priority is 10, but using a higher number makes my plugin modify the checkout later in the process – you will probably need to experiment to find the priority that makes my plugin’s changes happen after the conflicting plugin.
For example, a priority of 1001 seems to fix conflicts with the “Checkout Field Editor” plugin by ThemeHigh.
Filter Reference
For developers, I’ve included a few filters that you can use to customise certain aspects of the plugin. These are:
User Interface
All of these filters take one argument, $text
.
gazchaps-woocommerce-getaddress-io_find-address-button-text - the text shown on the Find Address buttons (default: Find Address)
gazchaps-woocommerce-getaddress-io_find-address-searching-text - the text shown when the Find Address button is selected (default: Searching...)
gazchaps-woocommerce-getaddress-io_enter-address-manually-text - the text shown for the "Enter an address manually" link (default: Enter an address manually)
Note: Although these two texts are translatable, filters will override any translations.
Error Messages
All of these filters take one argument, $message
, the error message that will be displayed to the user.
gazchaps-woocommerce-getaddress-io_api_error_400 - shown when the postcode supplied is invalid/empty
gazchaps-woocommerce-getaddress-io_api_error_401 - shown when the API key provided in the settings is invalid
gazchaps-woocommerce-getaddress-io_api_error_404 - shown when no addresses were found for the supplied postcode
gazchaps-woocommerce-getaddress-io_api_error_429 - shown when the API key has hit its usage limit
gazchaps-woocommerce-getaddress-io_api_error_500 - shown when there is a server error at getAddress.io
Note: By default, the error messages are “customer friendly”, i.e. they don’t go into much detail about the cause of the error!
Styling
gazchaps-woocommerce-getaddress-io_billing_selector_row_class - changes the CSS class on the form-row that the billing address selector is placed into
gazchaps-woocommerce-getaddress-io_shipping_selector_row_class - changes the CSS class on the form-row that the shipping address selector is placed into
gazchaps-woocommerce-getaddress-io_clear_additional_fields - defaults to true, set to '__return_false' to stop the "additional fields" area of the checkout having a clear style applied to it<h3>License</h3>Licensed under the [GNU General Public License v2.0](http://www.gnu.org/licenses/gpl-2.0.html)
Screenshots
-
The Find Address button on the default Storefront theme, before the lookup has been completed
-
The address selection drop-down menu on display
-
The administrator settings in the WooCommerce administration dashboard
-
The address lookup feature within the WooCommerce add/edit order screen