Shopify Cart

The Autoaddress jQuery plugin can be easily integrated to a standard Shopify cart by editing the theme code. If your Shopify site has a sliding cart, please contact us.

Requirements

To integrate Autoaddress into Shopify, the following is required:

  • A ​Shopify site with a standard (non sliding) cart page
  • An Autoaddress Licence Key (contact sales@autoaddress.ie for further info)
  • Code as noted in this document

Integration

Step 1: Open the Shopify Theme Code Editer

After logging into the Shopify dashboard for your site, open the Themes page by clicking the "Online Store" menu option on the left and selecting "Themes" from the sub-menu that appears:


Next, in the "Current Theme" section, select the "Actions" button and select the "Edit Code" option from the drop down menu:

The Themes code editor will now open.

Step 2: Configure Cart Template to Integrate Autoaddress

In the code editor, select the "cart.liquid" file in the "Templates" section of the menu on the left:

This will open the file in the editor:


Next, copy the following code below {% section 'cart-template' %}:

{% comment %}import js files{% endcomment %}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="https://api.autoaddress.ie/2.0/control/js/jquery.autoaddress.min.js"></script>

{% comment %}configure autoaddress control{% endcomment %}
<script>
    var licenceKey = "Your_Licence_Key";
    var addressProfile = "Shopify_Default";
    var language = "en";
    var geographicAddress = false;
    var vanityAddress = true;     
var roiOnly = false; </script> {% comment %}import shopify js{% endcomment %} <script src="https://api.autoaddress.ie/2.0/integrations/Shopify/shopify.min.js"></script>

Step 3: Configure Autoaddress Settings

Enter the licence key provided by Autoaddress and replace the text "Your_Licence_Key" with the value of the key.

Set the value of "roiOnly" to true or false depending on your requirements. If set to false, the plugin will include a dropdown box to allow users to select between Ireland and the UK.

Finally, click the "Save" button at the top of the file to complete the integration. Your sites cart will now contain the jQuery plugin to allow searching of addresses in your cart form. When clicking checkout, the information selected will be passed to the checkout form.