Locale-aware URLs for MultiMarket

Topic summary

A developer is implementing multi-market functionality and encountering issues with locale-aware URLs not working as expected despite following Shopify’s official documentation.

Core Problem:

  • Following Shopify’s guide for locale-aware URLs in multi-market setups
  • The /en-mx/ locale prefix is not appearing in URLs as documented
  • Base URLs remain unchanged even when using the recommended Liquid template syntax: <a href="{{ routes.cart_url }}">

Temporary Workaround:
The developer has opted for a JavaScript-based solution instead of relying on Shopify’s native Liquid routing:

  • Binding click events to links rather than using standard href attributes
  • Implementing custom JavaScript logic to construct locale-aware destination URLs
  • Using window.Shopify.routes to dynamically build proper URLs with query parameters

Status:
The issue remains unresolved through Shopify’s documented approach. The discussion appears ongoing with no definitive solution to make the native locale-aware URL system function correctly.

Summarized with AI on November 9. AI used: claude-sonnet-4-5-20250929.

I’m working on multi-market features and I’m struggling to have the correct URL.
I’m following this documentation which definitely is what I’m looking for but it does not work.

https://shopify.dev/docs/themes/markets/multiple-currencies-languages#locale-aware-urls

<a href="{{ routes.cart_url }}">{{ "templates.cart.go_to_cart" | t }}</a>

It should be a no-brainer but it does not work, I have still base URL.

To be more specific:

https://findify-liquid-playground.myshopify.com/en-mx/

The /en-mx/ is NEVER shown.

For the time being I will rely on Javascript side, so rather than having links on <a href=“{{ routes.url }}” I will bind an click event and then do this:

const getSearchDestination = (query) => {
  const root = window.Shopify.routes.root ? window.Shopify.routes.root : '';
  return `${root}search?q=${query}`;
};