Goal: Detect the current Shopify Market in Liquid to customize templates, since locale or currency aren’t unique per market.
Key update: The current market can be accessed in Liquid via {{ localization.market.handle }}. The handle serves as a unique identifier for the active Market.
Earlier suggestion: In absence of a Market variable, one could customize by country, but this was superseded by the confirmed Liquid solution above.
Follow-ups and open items:
JavaScript access: A participant asked if the Market data is available in JS. If not, a practical workaround is to render the value into the DOM (e.g., a hidden element or data attribute) and read it client-side. No definitive JS API answer was provided.
Default market check: Another participant asked how to determine if the selected Market is the default one. No solution was provided in the thread.
Status: Partially resolved. Liquid access via localization.market.handle is confirmed; JS access and default-market detection remain unanswered.
In our shop we use the Markets feature and we need to customise some templates depending on the market you are visiting from. There’s any liquid variable or tag to determine the market you are visiting from?
Using the locale or currency doesn’t work since they are not unique or each market.
At the moment there is no easy Liquid access for the Market chosen, I would invite you to check that link: How to Customize Content by Country with Shopify in case this could help, your alternative would seem to go via countries instead of markets.