Is there a way to get Locale-aware URLs on checkout page?

Topic summary

• Issue: On the checkout page, window.Shopify.routes.root is missing, making it unclear how to construct locale‑aware URLs when attempting to add items to the cart via the Cart Ajax API.

• Context/terms: Locale‑aware URLs adapt to a shopper’s language/region. The Cart Ajax API allows adding items asynchronously from the storefront. window.Shopify.routes.root is the client‑side base path used to build URLs consistently across locales.

• Developments: Another participant reports the same need for a solution. A third participant asks whether the issue was ever solved.

• Outcome/status: No guidance, workaround, or official answer is provided in the thread. The question remains open with unresolved key point: how to access or replicate locale‑aware URL construction on the checkout page without window.Shopify.routes.root.

Summarized with AI on January 2. AI used: gpt-5.

Hi, We want to add items to the cart from checkout page using cart Ajax API, but window.Shopify.routes.root for Locale-aware URLs is missing on checkout page.

How can we get Locale-aware URLs on checkout page?

Thanks,

Pengyi

1 Like

I need the answer to the same exact question.

did you ever solve this issue?