Jump to content

Auto Complete Address for New Zealand

Recommended Posts

Site URL: https://www.addy.co.nz/address-validation-javascript-code-generator

I know there's been some questions in the past about address auto complete form fields. I wanted to share a solution for anyone wanting address lookup and auto complete for New Zealand addresses. This solution is from https://www.addy.co.nz/address-validation-javascript-code-generator. It's simple to implement, just follow the guide on the Addy website. Note this is for regular form blocks, not checkout forms. I haven't tried it checkout forms, but I don't know it would work as there's no customisation with the commerce checkout form.  

The steps are simple:

  1. Sign up for a free Addy account and get the API key
  2. Create a form block in Squarespace, adding text fields for each address line (not the Address module, as it won't give you the ID tags you'll need). For example, create input fields for: Address, Suburb, Town, Post Code.
  3. Using Chrome browser, code inspect (for example), look up the ID of each address field tag, then copy the tag to the Addy address validation javascript code generator. Using a text editor or similar, insert your API key into that snippet (that Addy gave you when you signed up).
  4. Paste the generated JS snippet into Squarespace (Advanced > Code Injection) in the Footer. Add the <script type="text/javascript"> header and </script> footer to the code snippet. That's it. So easy.

Hope that helps all you Kiwis out there on Squarespace.

Link to comment
  • 1 year later...

Thanks Simon for sharing!

Hey community, I am after a similar solution that would work for checkout.

NZ website visitors would expect the address field to autocomplete once they start typing in their street. That's how all local websites work. I've set up 'Default Country' for my checkout as New Zealand, however addresses are still worldwide, which makes it really hard to find a NZ address (see below screenshot).

From my research online, there doesn't seem to be a solution at this stage. I believe that Squarespace doesn't support this functionality at checkout.

My website is https://www.themoneyjourney.co.nz/ and the URL for my cart is https://secure.squarespace.com/checkout?cartToken=kIWy26eQbOKh0czHSY2LztyiJprWS_rrHuk9oJnx&websiteId=6068e85dda18085693dc81b6

Thanks a million!

Christel

image.png.39f2eab7634a72f25e74b3d38be7c4e5.png

Link to comment
2 hours ago, Christel_NZ said:

I am after a similar solution that would work for checkout.

The checkout page can not be modified with custom code. It is a SS security feature.

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

Link to comment
  • 9 months later...
  • 2 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.