Is there no way to get the markets domain in liquid?
For example,
example.com as primary
fr.example.com as a markets domain
alias.example.com as an alias domain
shop.domain
and shop.url
all return the primary domain (example.com
as the domain and https://example.com
for the url).
I could have sworn that when Markets came out, shop.domain was showing the correct market domain. Was it changed or has this bug never been caught?
Hi @Ilana_Davis,
It looks weird to me aswell, tbh.
Can you use {{ request.origin }}
? Seems to return the correct URL for me.
This returns the myshopify domain
It might depend on your Markets structure.
I tested with this, on Danish based shop on the French market domain.
<script>
console.log('url', {{ shop.domain | json }}) // -> www.shop.dk
console.log('url', {{ shop.url | json }}) // -> https://www.shop.dk
console.log('url', {{ request.origin | json }}) // -> https://www.shop.fr
console.log('url', {{ request.host |json }}) // -> www.shop.fr
</script>
How is your Markets domains set up?
I have all different configs trying to see what works in my dev store but all subdomains.
Oh you may be right @curzey
When I look at the request.origin
or request.host
in the customizer, it returns the myshopify domain, but looking at the output on the live site, it shows the market domain.