You’re definitely on the right track with using localization.market.handle, but there’s a key limitation with how Shopify handles Markets in theme preview mode.
When you’re using the theme preview URL, Shopify doesn’t fully simulate Markets behavior (like geolocation or manually selected markets). If you switch to the New Zealand market in the market selector, it redirects to the live site, which breaks the preview and your ability to test your liquid condition:
{% if localization.market.handle == 'NZ' %}
Welcome to the NZ market
{% endif %}
This works perfectly in production, but not inside theme preview.
Here are a couple of workarounds you can try:
1. Simulate market via URL parameter (for testing only)
You should be able to temporarily modify your theme to detect a fake market parameter in the URL:
{% assign debug_market = request.query_params.market %}
{% if debug_market == 'NZ' %}
Welcome to the NZ market (debug mode)
{% endif %}
Then test it with a URL like:
https://your-store.myshopify.com/?preview_theme_id=123456789&market=NZ
This won’t use Shopify’s localization object, but it lets you simulate the output during development.
2. Use localization.country.iso_code as a fallback
If your markets are country-based (e.g., NZ market = New Zealand), you can use:
{% if localization.country.iso_code == 'NZ' %}
Welcome to the NZ market
{% endif %}
This tends to work better in preview mode since localization.country is often available even if market isn’t.