Developer forum

Forum » Ecommerce - Standard features » Multiple websites for add to cart, a single website for checkout

Multiple websites for add to cart, a single website for checkout

Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,

I have a situation with a solution used for multiple websites. One of the websites is an actual shop while the others are more marketing sites.

Each site has its own domain name.

The customer wants to allow users to add to cart from the marketing sites but the checkout should only happen through the shop (one of the websites on the solution).
How do I configure the persistence of the cart between domains? Is it even possible?

If I set the add to cart to always use the shop domain instead of the marketing domain, would that help?

Thank you,
Adrian


Replies

 
Nicolai Pedersen
Reply
This post has been marked as an answer

Hi Adrian

Cross domain has its limitations due to how browsers work. Each domain has different set of cookies and can then not share information. If they are on different subdomains of the same domain, Dynamicweb can be configured to share cookie on the domain instead of the host (sub domain).

If you are operating with logged in users, that can handle it for you.

So if you have anonymous users on differetn domains, i.e. shop1.com and shop2.com, you need some custom logic to link between the sites and pick up the basket correctly. You might be able to do something using javascript - i.e. place a script that you include on shared.maindomain.com/js/cartidmanager.js that will be able to move the cartid/cartsecret into a javascript cookie on the maindomain.com. When moving from shop1 and shop2 this js is included in both places and can access that cookie and you can make some logic that will find the cartid from the javascript cookie and put it alive on shop1/shop2.

Be aware of and read up on CORS.

BR Nicolai

Votes for this answer: 1
 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

Thank you for your suggestions.

I am aware of the CORS issues. I was very interested in the dependencies for picking up the basket correctly.

I will not have authenticated users, all will be anonymous.

I will take that into consideration.

Thank you very much,

Adrian

 

You must be logged in to post in the forum