diff --git a/layout/theme.liquid b/layout/theme.liquid index 04e947d..271c16c 100644 --- a/layout/theme.liquid +++ b/layout/theme.liquid @@ -59,7 +59,7 @@ endcapture %} - console.log("2", "url {{ shx_get_environment }}", "{{ shop.url }}") + console.log("2", "url {{ shx_get_environment }}", "{{ shop.permanent_domain }}") diff --git a/snippets/shx-get-environment.liquid b/snippets/shx-get-environment.liquid index a352c54..98896b3 100644 --- a/snippets/shx-get-environment.liquid +++ b/snippets/shx-get-environment.liquid @@ -1 +1,9 @@ -{{ shop.url }} \ No newline at end of file +{% assign domain = shop.permanent_domain %} + +{% if domain contains 'myshopify.com' %} + {% assign environment = 'development' %} +{% else %} + {% assign environment = 'production' %} +{% endif %} + +"{{ environment }}" \ No newline at end of file