Overview
↑ Back to topHeads up! The SmartyStreets integration was retired on October 4, 2022. US stores must switch to Loqate to continue using Postcode/Address Validation with WooCommerce. Learn more about the retirement or view instructions for setting up Loqate
As of WooCommerce 8.3, Cart and Checkout blocks are available as the default experience. WooCommerce Address Validation has not yet been updated to be compatible with those blocks, so we recommend following this guide to revert to Cart/Checkout shortcodes. Additional plugin updates will soon be released to ensure compatibility with the new block checkout. Please check out this page for the latest updates or reach out to our support team with any questions!
Provider comparison
↑ Back to topProvider | Services offered | Countries | Free Lookups? |
---|---|---|---|
Loqate | Address auto-complete Classify addresses | all countries | – |
Loqate (legacy) | Postcode lookup | UK | – |
Postcode.NL | Postcode lookup | NL | – |
Postcode Software | Postcode lookup | UK | – |
Fetchify | Postcode lookup | UK | 30 total |
See a demo of Postcode/Address Validation in action (using Loqate)
Installation
↑ Back to top- Download the extension from your WooCommerce dashboard
- Go to Plugins > Add New > Upload and select the ZIP file you just downloaded
- Click Install Now, and then Activate
- Click the Configure link and read the next section to learn how to setup and configure the plugin.
Setup and Configuration
↑ Back to top- Provider – Select the provider you’d like to use for address validation or postcode lookup.
- Debug Mode – Enable this to output debugging information on the checkout page. As a best practice, you should leave this disabled unless you experience issues with the plugin.
- Classify Addresses? – (US providers) Enable this to save an address classification (Residential or Commercial) to the order.
- Force Customer to lookup address via postcode – (Postcode lookup providers) Enable this to force customers to use postcode lookup; address fields will be hidden until lookup is used. Note that once the customer clicks “Lookup Address”, the address fields are displayed regardless of whether the lookup is successful.
Loqate Settings
↑ Back to topIf you had previously signed up with the Addressy service, Loqate has grandfathered in a small number of free lookups each month for legacy users of this service. New users to the Loqate service are not entitled to these free lookups each month and are instead granted free credits upon signup.
- Service Key – Enter your service key from Loqate. You can follow the instructions below to get this.
- Validate International Addresses – Enable this to allow address auto-complete for addresses outside of the US. When disabled, only US addresses will use Loqate to lookup addresses.
Postcode.NL Settings
↑ Back to top- Application Key – Enter the application key from your Postcode.NL account. You can follow the instructions below to get this.
- Application Secret – Enter the application secret from your Postcode.NL account. You can follow the instructions below to get this.
Loqate (legacy) Settings
↑ Back to top- API Key – Enter the API key from your Loqate Account. You can follow the instructions below to get this.
- API Username – Enter the username associated with your Royal Mail account. If you do not have a Royal Mail account, leave this blank.
Postcode Software Settings
↑ Back to top- Account Number – Enter the account number for your Postcode Software account. You can follow the instructions below to get this.
- Password – Enter the password for your Postcode Software account. You can follow the instructions below to get this.
Fetchify Settings
↑ Back to top- Access Token – Enter the access token from your Fetchify account. You can get this by following the instructions below.
Connect to a Service
↑ Back to topLoqate
↑ Back to top- Click the “Add service” button at the top of your account dashboard.
- Click on “API key” to create a new key for your store.
- Copy the service key generated by Loqate:
- Enter this service key in the plugin settings, then save your settings.
- Optional: You can adjust the name of this key under “Configuration”, and set limits under “Limits”, such as restricting the number of lookups per day, limiting this key to a single URL for your site (recommended), or limiting the number of lookups by customer.
Postcode.NL
↑ Back to topLoqate (legacy UK)
↑ Back to topPostcode Software
↑ Back to topFetchify
↑ Back to top- Click “Access Tokens & Statistics” on the left, then click on your access token:
- Copy the token value:
- Enter this token in the plugin settings and save them.
Customer Experience
↑ Back to topLoqate Auto-complete
↑ Back to topPostcode Lookup
↑ Back to topMy Account Pages
↑ Back to topTroubleshooting
↑ Back to top- Check that you have entered your API key/Access Token correctly.
- Double-check that you have entered your API key correctly. 😉
- Confirm that you have enough credits with your selected provider to perform verifications or lookups.
- Double-check that you have enough credits with your selected provider. 😉 for example, Loqate will say it can’t retrieve an address when you’re out of credits:
- Verify that there are no javascript errors on the checkout page — address lookup and verification rely on checkout javascript to be functioning properly. If you have a third-party theme or plugin that is breaking your javascript, it will likely affect this plugin as well.
- Ensure that the country field is present on your checkout page so the plugin can get accurate results. If you’ve customized your checkout and removed this, it can cause issues with address lookup.
- Worried about orders going through if US Validation fails? Please see our FAQ below.
- Enable Debug mode by going to WooCommerce > Settings > Address Validation and checking the “Debug Mode” checkbox. This will output information to the checkout page that will help in locating the source of the issue.
- If these steps don’t help narrow down the issue, please submit a help request and we’d be happy to assist.
PostcodeSoftware.net
↑ Back to topFrequently Asked Questions
↑ Back to topQ: Help! My customers can still check out even though the address is not validated. A: This is the expected behavior of the plugin and is part of the way the address validation libraries work. Validation will suggest the “recommended” correction, but it will not block an order from processing if validation fails. The customer must ensure the address is correct, as there are legitimate reasons it may not validate; for example, it may be a new address / new construction that Loqate doesn’t have logged yet, and the order should not be blocked as a result. This also ensures that, if for some reason the validation service’s servers are ever unreachable, the checkout isn’t completely locked down if it can’t validate addresses.
Q: Can I use this with One Page Checkout? A: Yes! One Page Checkout is supported in Postcode / Address Validation from version 1.4.0 and onwards.
Q: Why isn’t the postcode lookup at the top of checkout? Why does it look strange on my checkout page? A: WooCommerce core places the country field first in the checkout since the selected country affects the remaining fields. Similarly, the Address Validation postcode lookup is tied to the selected country because the postcode lookup providers bundled in the extension only support a single country (but shops often sell to multiple countries). As we want the postcode lookup fields to only appear when the supported country is selected by the customer, we make sure the lookup fields are tied with the country field and are typically displayed first. If you’ve moved the country field away from the top of the page (for example, by using the Checkout Field Editor), then the Address Validation fields will go with it :). The extension assumes the billing and shipping country fields have not been moved and appends the postcode lookup fields below the country field. Placing the postcode lookup fields anywhere else breaks the user experience and defies the purpose of the plugin: to allow customers a quick way to lookup their address via a postcode rather than filling out all fields. We highly recommend that you keep the country field first on your checkout template. If this is impossible, you could use the snippet below (or something similar), but please note that customization requests / custom code are not included in our support policy:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function wc_address_validation_move_postcode_lookup() { | |
wc_enqueue_js( ' | |
( function() { | |
var $billingLookup = $( "#wc_address_validation_postcode_lookup_billing" ); | |
var $shippingLookup = $( "#wc_address_validation_postcode_lookup_shipping" ); | |
$( "div.woocommerce-billing-fields").find( "h3" ).after( $billingLookup ); | |
$( "div.woocommerce-shipping-fields").find( "h3" ).after( $shippingLookup ); | |
} )(); | |
' ); | |
} | |
add_action( 'wp', 'wc_address_validation_move_postcode_lookup', 1000 ); |
Q: Why is SmartyStreets no longer available as a provider? A: SmartyStreets retired the API that was integrated with our plugin on October 4, 2022. They previously suspended new account connections through this API, and with the retirement all existing account connections ceased functioning as well. As a result, we removed SmartyStreets as a provider option. We recommend setting up a Loqate account and using their service as a provider to continue validating US addresses with our extension.