Addressfinder

The best way to find exact addresses in New Zealand

  • Skip to Main Navigation
  • Skip to Footer Sitemap
  • Skip to Top
  • About
    • About Us
    • Case Studies
    • FAQ
    • Partners
    • Blog
    • Contact Us
  • Pricing
  • Industries
    • E-commerce
      Collect verified delivery addresses
    • Finance
      Verified address data for KYC and AML
    • Utilities
      Make network connections faster
  • Features
    • Address Autocomplete
      Search verified addresses as you type
    • Bulk Cleansing
      Verify your database of addresses and emails
    • Email Verification
      Collect only valid email addresses
    • Phone Verification
      Verify numbers at the point of collection
    • Geocode Addresses
      Collect addresses and GPS coordinates together
    • Address Metadata
      Get extra data about addresses
    • MORE FEATURES
  • Address Verification
    • Integration Guide
    • Javascript Reference
    • Code Examples
    • API Reference
    • Code Generator
    • International Integration
  • Email Verification
    • Integration Guide
    • Javascript Reference
    • Code Examples
    • API Reference
  • Phone Verification
    • Integration Guide
    • Javascript Reference
    • Code Examples
    • API Reference
  • About
    • About Us
    • Case Studies
    • Frequently Asked Questions
    • Partners
    • Blog
    • Contact Us
  • Pricing
  • Industries
    • E-commerce
      Collect verified delivery addresses
    • Finance
      Verified address data for KYC and AML
    • Utilities
      Make network connections faster
  • Features
    • Address Autocomplete
      Search verified addresses as you type
    • Bulk Cleansing
      Verify your database of addresses and emails
    • Email Verification
      Collect only valid email addresses
    • Phone Verification
      Verify numbers at the point of collection
    • Geocode Addresses
      Collect addresses and GPS coordinates together
    • Address Metadata
      Get extra data about addresses
    • MORE FEATURES
  • Documentation
    • Integrations
      • Magento
      • WooCommerce
      • Hubspot
      • Salesforce
      • Shopify Plus
      See all integrations
    • Address Verification
      • Integration Guide
      • Javascript Reference
      • Code Examples
      • API Reference
      • Code Generator
      • International Integration
    • Email Verification
      • Integration Guide
      • Javascript Reference
      • Code Examples
      • API Reference
    • Phone Verification
      • Integration Guide
      • Javascript Reference
      • Code Examples
      • API Reference
  • Login
  • Blog
    • Integrations
      • The StoreConnect - Addressfinder Integration for New Zealand

The StoreConnect - Addressfinder Integration for New Zealand

#Integrations #Addressfinder #Javascript #New Zealand #Shipping #eCommerce

One of the many benefits of the StoreConnect platform is that it provides seamless integration. This resonates with us here at Addressfinder as we are also driven to deliver a service which is smooth and seamless. To this end we have created some very easy-to-follow steps so that you can have Addressfinder up and running on your checkout in minutes. To us, this sounds like “Time. Well Spent” for both you and your customers making purchases.

SC-logo.png

Why add Addressfinder to your checkout?

Shipping outcomes

The Addressfinder service returns only verified, formatted and accurate address information which enables successful delivery on the first attempt.

Connection

When a customer can search and select their address on the checkout, they feel a connection to the sale and know the goods will soon be on their way home. When addresses are not available, customers get nervous and start to disconnect.

Time

Getting the customer to the ‘buy now’ button quickly means less time for them to be distracted or interrupted and abandon the sale.

af-logo-small for blogs.png

Integration instructions

Step 1 - Creating a new script block

1.- Open the App Launcher

2.- In the search bar, search and select ‘Script blocks’.

SC1.1.png


3.- Create a new script block.


SC2.png

Step 2 - Populate the New Script Block

1. Give the Script Block a name (Addressfinder).

2. Choose the store for this script to be run on.

3. Paste the Widget Javascript code (below) into the Content field.

4. Save.

SG3.png

Step 3 - Test

1. Go to your website checkout page and start typing an address into the Street Address field.

2. Check that addresses are being displayed in a drop down box below the Street Address field.

3. Select an address and check that the address information populates the correct fields.

StoreConnect3.png


Widget Javascript Code:

NB: Replace the “ADDRESSFINDER_DEMO_KEY” with your Addressfinder account key in the code below.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
(function() {
    var stateMappings = {
    "Auckland Region" : "AUK",
    "Bay of Plenty Region" : "BOP",
    "Canterbury Region" : "CAN",
    "Gisborne Region" : "GIS",
    "Hawke's Bay Region" : "HKB",
    "Manawatu-Wanganui Region" : "MWT",
    "Marlborough Region" : "MBH",
    "Nelson Region" : "NSN",
    "Northland Region" : "NTL",
    "Otago Region" : "OTA",
    "Southland Region" : "STL",
    "Taranaki Region" : "TKI",
    "Tasman Region" : "TAS",
    "Waikato Region" : "WKO",
    "Wellington Region" : "WGN",
    "West Coast Region" : "WTC",
    "Area Outside Region" : "CIT"
     };
  
    var widget, initAddressFinder = function() {
        var addr_element = document.getElementById('checkout_customer_information_form_shipping_address_1') ||
            document.getElementById('checkout_customer_information_form_shipping_address_line_1');

        widget = new AddressFinder.Widget(
            addr_element,
            '98G3HDF4XVRAQBUWKLJP',
            'NZ', {
                "address_params": {
                    "post_box": "0"
                },
                "max_results": "7"
            }
        );
        widget.on('result:select', function(fullAddress, metaData) {      
          var combinedAddressLine1And2 = !metaData.address_line_2 ? 
            metaData.address_line_1 : 
            metaData.address_line_1 + ', ' + metaData.address_line_2;
          
          var combinedSuburbCity = !metaData.selected_suburb ? 
            metaData.selected_city : 
            metaData.selected_suburb + ', ' + metaData.selected_city;
          
          addr_element.value = combinedAddressLine1And2;
          document.getElementById('checkout_customer_information_form_shipping_city').value = combinedSuburbCity; 
          document.getElementById('checkout_customer_information_form_shipping_postal_code').value = metaData.postcode; 
          document.getElementById('checkout_customer_information_form_shipping_state').value = stateMappings[metaData.region];
        });
    };

    function downloadAddressFinder() {
        if (
            !document.getElementById('checkout_customer_information_form_shipping_address_1') &&
            !document.getElementById('checkout_customer_information_form_shipping_address_line_1')
          ) {
              return;
        }

        var script = document.createElement('script');
        script.src = 'https://api.addressfinder.io/assets/v3/widget.js';
        script.async = true;
        script.onload = initAddressFinder;
        document.body.appendChild(script);
    };

    document.addEventListener('DOMContentLoaded', downloadAddressFinder);
})();


Help and support

If you have extra fields or wish to collect other address information take a look at our custom integration guide or get in touch with us - support@addressfinder.nz.

Thanks.

#Integrations #Addressfinder #Javascript #New Zealand #Shipping #eCommerce
Published: 7 October 2022
Matt Ramsay
Matt Ramsay
Addressfinder logo
Addressfinder provides speedy, accurate and dependable address autocompletion at a fair price. Easily integrate our address finder software with your site to start enjoying our address verification, address autocomplete and other address services today.

Sitemap

  • About
  • About Us
  • Contact
  • Blog
  • FAQ
  • Pricing
  • Case Studies
  • Status Page
  • Privacy Policy (Service)
  • Privacy Statement (Website)
  • Terms & Conditions
  • Features
  • Address Autocomplete
  • Address Metadata
  • Bulk Address Cleansing
  • Address Geocoding
  • Email Address Verification
  • International Autocomplete
  • Reverse Address Lookup
  • Points of Interest
  • Street, Suburb & City Search
  • Postcode Finder
  • Address Verification
  • Integrations
  • WooCommerce
  • BigCommerce
  • Shopify Plus
  • Magento
  • Salesforce
  • Spiffy Stores
  • iOS
  • Ruby
  • HubSpot
  • StoreConnect
  • Drupal
  • Microsoft Dynamics 365
  • Vue
  • Gravity Forms
  • React
  • API Documentation
  • Address Autocomplete
  • Address Metadata
  • Address Verification
  • Email Verification
  • Phone Verification
  • API Errors
  • AU APIs specs
  • International APIs
  • Widget Documentation
  • Integration Guide
  • Javascript Reference
  • Code Examples
  • Widget Code Generator
  • International Integration Guide
  • Email Integration Guide
  • Phone Integration Guide
Addressfinder is also available in Australia
Terms and Conditions
Copyright © 2023 Addressfinder, New Zealand