Developer forum

Forum » Ecommerce - Standard features » One extranet login with individual carts

One extranet login with individual carts

Harald Brouwers
Reply

Hi,

My users share one extranet login to get into the shop and see a specific Assortment of products.

Although they share the same login, every visitor needs to get their own individual cart, how do I configure my site to make sure every visitor gets their own cart?


Replies

 
Nicolai Høeg Pedersen
Reply

Hi Harald

Try setting the "Do not replace existing cart when user logs in" checkbox in MC, see dump.

An alternative is to create a Notifications.Standard.User.OnExtranetLogin notification subscriber and setting set an empty order: eCommerce.Common.Context.SetCart(New Order());

BR Nicolai

Capture.PNG
 
Harald Brouwers
Reply

Hello Nicolai,

I tried both options, but none of them are working.

What is was wondering, has this someting to do with the usage of ContextCarts? Do I maybe need te specify the specific context in which the new cart is created? And if this is the case how do I realize that?

Greets

 
Nicolai Høeg Pedersen
Reply

Hi Harald

Yes, if you use context carts, you need of course to override that one with a new cart.

You need to make sure you have set the right eCommerce.Common.Context.CartContext before you call SetCart(New Order())

 
Harald Brouwers
Reply

Hi Nicolai,

I'm sorry to ask, but how do I set the CartContext in my Notification subscriber?

eCommerce.Common.Context.CartContext is readonly, so my guess is that I have to use: eCommerce.Orders.OrderContext.GetOrderContextById("MYCONTEXT"); which gives me the right context I want to use. But how do I set it so that the SetCart is aware of the context?

Greetz

 

You must be logged in to post in the forum