Many modern websites and web applications operate across multiple sub-domains to serve different audiences, brands, or purposes (for example, https://www.freedombuilt.com/
, https://nautilife.freedombuilt.com/
, or https://isaidyes.freedombuilt.com/
). In these scenarios, it’s often necessary to conditionally render different UI layouts, styles, or content depending on which sub-domain the visitor is accessing.
Specific Context:
I’m working on a Shopify theme implementation where the same theme needs to load different sections or UI elements dynamically, based on the active sub-domain.
However, I’ve encountered a significant challenge:
When a product is added to the cart on https://www.freedombuilt.com/
, the cart does not persist across https://nautilife.freedombuilt.com/
or https://isaidyes.freedombuilt.com/
. Carts created on one sub-domain remain isolated and do not carry over to the others.
My objective is to ensure that the same cart contents are shared across all sub-domains, so users have a seamless experience when navigating between them.
I’d appreciate any guidance on how to achieve this—thank you in advance!