Skip to content

Instantly share code, notes, and snippets.

@gbrits
Created December 1, 2021 17:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gbrits/d7a079be14fe7b690d132d35739e6b6a to your computer and use it in GitHub Desktop.
Save gbrits/d7a079be14fe7b690d132d35739e6b6a to your computer and use it in GitHub Desktop.
Country-specific notice (Shopify)
{% if template == 'index' %}
fetch('https://api.ipregistry.co/?key=tryout')
.then(function (response) {
return response.json();
})
.then(function (payload) {
if('Australia' == payload.location.country.name){
$('#international-notice').show();
}
});
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment