Posted on 14/03/2022 13:42:30
Hi,
Can anyone help with this issue?
We would like to create a cart programatically. This seems like it works fine, but we cannot seem to get it to replace the current users cart on the front end.
From what I have read this is supposed to do that:
Dynamicweb.Ecommerce.Common.Context.SetCart(newcart);
Even though this is already in the frontend user context we have also set this to ensure the correct context:
Dynamicweb.Security.UserManagement.User user = Dynamicweb.Security.UserManagement.User.GetUserByID(changedArgs.Order.CustomerAccessUserId);
Dynamicweb.Security.UserManagement.User.SetCurrentUser(PagePermissionLevels.Frontend, user);
Any suggestions would be appreciated.
Regards,
Jon.