We have two websites through a single licence. We are facing an issue while managing users and their shopping cart.
The user can login both websites using single login details but whenever they add a product to their shopping cart from website A the same product will display in the shopping cart of website B when they come to website B. In straight forward we do not want to share the shopping cart for different website for the same user.
If anyone having a solution please let me know.
Do you use market concept at all? To make thing easier you can define different markets for each site. For example, US-A for site A and US-B for site B, both for US market.
Another approach is to have the carts named differently, for example, "Default-A" for site A and "Default-B" for site B.
Episerver Commerce has APIs to load a named cart for a specific customer in a specific market. Carts are unique per name/customer/market.
Thanks for your reply.
I have created two separate markets as you mentioned but I couldn't find where should I assign this market for each website from commerce manager.
No, it's the way around. Each website can have multiple markets, you won't be able to " this market for each website from commerce manager". For each site you can use ICurrentMarket to set the current market for that website, and the code which relies on market with work accordingly.
Is this possible to set the current market in Session_Start of global.asax. Can you please send me the sample code for that.
You can just get the instance of ICurrentMarket (ServiceLocator.Current.GetInstance<ICurrentMarket>()), then call SetCurrentMarket with the market you want to use.