Change the order and scope of the autocomplete typeahead for billing/shipping address

We use a different order in the Netherlands:

Street - House Number - Postal Code - City

For our user base an address with the house number first is just weird.

Is there a way to change the order of the Typeahead autocomplete?
And if so, is there a way to scope it to just addresses in our country?

Hey @Ronald,

We’re working on improvements regarding the address autocomplete, it works well for customers in North America at the moment, but we noticed some issues for customers in Europe for instance.

We can disable this feature for your account until we make the improvements, if you’d like us to proceed with this, just send us a quick email at support@snipcart.com with the email associated to your Snipcart account and we’ll update it.

Thanks,

1 Like

Thanks for your answer.

Yeah, I can understand it works very well in North America. :slight_smile:

I chose to not use autocomplete for now, but to override the checkout components. So nothing to disable here I guess?

Exactly, overriding the component is another way to disable the feature. Since it was requested by quite a lot of users, we decided to feature flag it too, so we can disable it per account on our side too.

1 Like

Hi there @charles ! In the release notes for the last update I noticed a line:
“Billing and shipping address autocomplete feature in the cart was improved for customers in Europe.”

Is that related to this issue? I don’t see it fixed, can you share what changes have you done?

1 Like

I still see the address in the ‘wrong’ order so I guess not that. :slight_smile:

@charles From what I can tell, you are calling https://app.snipcart.com/api/localization/addresses/... to “localize” the addresses.

But I’m not sure why exactly are you doing that since Google already sends you the local address. No matter where the webshop is, the addresses should be in their native format, and Google provides you with exactly that (formatted_address is in the correct format).

I guess you’re using Address Component Types to fill the fields for checkout - in that case, the simplest solution would be to compare the formatted_address with the one you can recreate, and see if its street_number route (e.g. 226 Rue Saint-Joseph E) or the other way around.

1 Like