Sharing a cart between subdomain and main storefront (configurator use case) #634
Replies: 2 comments 1 reply
-
|
Sounds cool!
If you're using Swell.js (the Frontend API), then it creates a cookie on whichever domain initiated the session. I suppose you could transfer the cookie to another domain manually, or use a different solution for session management. The session basically just contains the
Going by memory here, you may be able to implement logic to create a 2nd cookie on the TLD that is agnostic to the subdomain. Whenever the configurator creates a session with a cookie for I'm not sure if we have a best practice here since it hasn't come up as a common use case, but whichever solution you choose may influence our future recommendations :) |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for the detailed explanation — that clarifies things well. So to confirm our understanding:
Given that, we’ll proceed with a custom approach on our side:
We may experiment with a TLD-level cookie, but agree that an explicit cart handoff/merge is the more robust solution. Appreciate the insight — happy to share feedback once we’ve implemented this. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I’m building a custom product configurator that needs to live on a subdomain (e.g.
config.example.com). After configuring a product, the user should be able to continue shopping and check out on the main storefront (www.example.com) with the configured items already in their cart.I’m trying to understand the intended / supported way to do this in Swell.
Specifically:
Cart + cookies
Domain=.example.com)?Cross-domain cart handoff
Best practice
I’m happy to implement a token-based redirect or cart rebuild flow if that’s the intended solution — just want to align with Swell’s best practices.
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions