I have a case where I would like to share an "anonymous" cart across devices. Here it is possible for me to send "CustomerId" in a QueryString to the other device.
I use this code to share the cart between devices:
public ICart CloneAndLoadCart(Guid customerId)
{
var existingCart = _orderRepository.LoadCart<ICart>(customerId, DefaultCartName, _currentMarket);
if (existingCart == null)
return null;
var clonedCart = (ICart)((Mediachase.Commerce.Orders.Internal.IDeepCloneable)existingCart).DeepClone();
clonedCart.CustomerId = CustomerContext.Current.CurrentContactId;
SaveCart(clonedCart);
return clonedCart;
}
Can it be done in a better / nicer way?
It is said here, that "IDeepCloneable Interface" "is not intended to be used directly from your code".
error This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
Hi there,
I have a case where I would like to share an "anonymous" cart across devices. Here it is possible for me to send "CustomerId" in a QueryString to the other device.
I use this code to share the cart between devices:
Can it be done in a better / nicer way?
It is said here, that "IDeepCloneable Interface" "is not intended to be used directly from your code".
Br
Lasse