# ![AddressZen ShopWired Integration](https://img.ideal-postcodes.co.uk/Shopwired%20Integration%20Logo@3x.png)

Shopwired Integration for UK Address Search and Validation

## Features[​](#features "Direct link to Features")

* Address autocompletion on:

  <!-- -->

  * Checkout (shipping and billing pages)
  * User registration page
  * Account details page

* Checks if the API Key is usable before enabling autocomplete

* Populates organization name from selected address

info

If you need support, you can either reach out to us on our [support page](https://addresszen.com/support) or drop by our [developer chat page](https://chat.ideal-postcodes.co.uk).

## Screenshots[​](#screenshots "Direct link to Screenshots")

![Shopwired Demo](https://img.ideal-postcodes.co.uk/shopwired-demo.gif)

### Address Lookup[​](#address-lookup "Direct link to Address Lookup")

![Activate Address Lookup on your address collection forms-screenshot](https://img.ideal-postcodes.co.uk/shopwired-autocomplete.png)

## Enable on Checkout[​](#enable-on-checkout "Direct link to Enable on Checkout")

To enable Address Validation on checkout, you will need to use ShopWired's Advanced Customization.

### Access Advanced Customization[​](#access-advanced-customization "Direct link to Access Advanced Customization")

From the Administration page sidebar, navigate to `Checkout` → `Platform Checkout` and scroll down to `Advanced Customization`.

### Insert Activation Code[​](#insert-activation-code "Direct link to Insert Activation Code")

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/shopwired@2">

</script>
```

When inserting the configuration and initialization 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.

## Enable on Accounts[​](#enable-on-accounts "Direct link to Enable on Accounts")

To enable Address Validation on user accounts and other pages you will need to update your ShopWired theme template.

![Go to theme template-screenshot](https://img.ideal-postcodes.co.uk/shopwired-twig-1.png)

### Access Theme Templates[​](#access-theme-templates "Direct link to Access Theme Templates")

From the Administration page sidebar, navigate to `Themes` → `Installed Themes` click on `Page Editor`.

![Access the page editor-screenshot](https://img.ideal-postcodes.co.uk/shopwired-twig-2.png)

### Insert Activation Code[​](#insert-activation-code-1 "Direct link to Insert Activation Code")

From the `Page Editor`, click on `Views` then `Templates` then `master.twig`. At the bottom of the editor before `</body>`, add the same activation code as the checkout section (above).

![Insert configuration code-screenshot](https://img.ideal-postcodes.co.uk/shopwired-master.png)

Once again update `apiKey`.

## Configuration[​](#configuration "Direct link to Configuration")

The minimum configuration is as follows:

```
<script>

  window.idpcConfig = {

    apiKey: "Your API Key goes here"

  };

</script>
```

See our [integration configuration guide](https://ideal-postcodes.co.uk/guides/integration-configuration) to understand how to customize this.

### Defaults[​](#defaults "Direct link to Defaults")

The available configuration attributes for the configuration are as follows:

```
{

   // API Key is not set by default

  apiKey: "",



  // Autocomplete is enabled

  autocomplete: true,



  // Company name field is updated

  populateOrganisation: true,

  // County name field is not updated

  populateCounty: false,

  

  // Advanced configuration

  autocompleteOverride: {},

}
```

## Upgrades[​](#upgrades "Direct link to Upgrades")

This integration will be continually updated without your action. However there will be occasion when a backwards breaking change is introduced. When this happens we will increment the version number at the end of the script `src`.

## Admin Pages[​](#admin-pages "Direct link to Admin Pages")

To enable address validation on your admin page, you will need to use our [Browser Extension](https://ideal-postcodes.co.uk/browser-extension).

![Browser Extension-screenshot](https://img.ideal-postcodes.co.uk/shopwired-extension-demo.gif)
