Open Nav

BigCommerce

BigCommerce integration for UK address search and validation

Updated 19 May 2020

Ideal Postcodes BigCommerce Integration

Ideal Postcodes provides a BigCommerce integration that facilitates UK address search and validation across a BigCommerce Store.

This extension is free to download and install. However, our address validation services requires a paid account at ideal-postcodes.co.uk.

This integration works by hooking into the custom scripts enabled for Google Analytics. It waits until a valid address form is present before binding itself.

Contact us if you get stuck. Drop by our developer chat page for in-depth assistance.

Features

  • Address autocompletion on checkout shipping and billing pages
  • Checks if key is usable before enabling autocomplete
  • Populates organisation name from selected address

Screenshots

Address Autocomplete

Activate address autocompletion on your address collection forms.

Address Autocomplete

Links

Support

If you need support, you can either reach out to us on our support page or drop by our developer chat page.

Installation

This integration is installed via embedding scripts in Script Manager.

1. Create a Script in Script Manager

From the Administration page, click on Store Front and then Script Manager.

Next, click on the blue Create a Script button.

Script Manager page before

On the Create Script page, name your script. Select the following options:

  • Footer as the location on page
  • Checkout as the page on which the script will be added
  • Essential as the script category
  • Script as the script type

Edit Script page

2. Insert Initialisation Code and Key

In the Script contents editor, insert the below configuration code and click on Save.

  <script>
    window.idpcConfig = {
      apiKey: "Your API Key goes here"
    };
  </script>

  <script async 
    type="text/javascript"
    crossorigin="anonymous"
    src="https://cdn.jsdelivr.net/npm/@ideal-postcodes/bigcommerce@Y.Y.Y">
  </script>

The page should appear like below:

Insert initialisation code

When inserting the configuration and initialisation codes into the editor, take special care to replace the following:

  • The apiKey attribute in the first script tag. This should be replaced with the key on your account
  • The version number of the second sript src field. The latter Y.Y.Y in "https://cdn.jsdelivr.net/npm/@ideal-postcodes/bigcommerce@Y.Y.Y" should be replaced with the relevant version number.

The latest version number is below:

npm version badge

Versions are automatically logged and tracked on our Changelog.

The Script Manager page should now reflect the changes made.

Script Manager page after

Testing and Going Live

Your first key on your Ideal Postcodes account will carry a free test balance which you can use to verify and test your integration. When you are ready to go live, you will need to add a live balance to your Key either manually or with automated top-ups.

View our guide on how to create your first Ideal Postcodes API key and enable automated top-ups.

Configuration Options

Within the Configuration script tag, you may make adjustments to alter the behaviour of your integration. These are listed below:

Required

apiKey

string defaults to ""

The API Key is required to verify your account for address validation. This can be found on your account dashboard on ideal-postcodes.co.uk.

autocompleteOverride

object defaults to {}

Manually override the autocompletion plugin configuration.

Pass in a valid configuration object to override specific autocomplete configuration attributes.

populateOrganisation

boolean defaults to true

Addresses selected which carry an organisation attached will overwrite the value of the Company Name field.

Configuration Defaults

{
  apiKey: "",
  populateOrganisation: true,
  autocompleteOverride: {}
}

Safeguarding Your API Key

For more information on how to protect your API key against potential misuse, please visit our guide on securing your API key.