AI OnAI Off
Hi,
Apologize for answering my own question. None of provider do this for us, we have to add this at time of registration or on login.
public void SetCustomerContact(string userName) { var currentUser = this.userProfileRepository.GetUserProfile(snUser); var user = System.Web.Security.Membership.GetUser(userName); if (currentUser != null && user != null) { var customerContact = CustomerContext.Current.GetContactForUser(user); if (customerContact == null || customerContact.PrimaryKeyId == Guid.Empty) { // Now create an account in the ECF customerContact = CustomerContact.CreateInstance(user); } if (customerContact == null) { return; } customerContact.FirstName = currentUser.FirstName; customerContact.LastName = currentUser.LastName; customerContact.RegistrationSource = String.Format("{0}", SiteContext.Current); customerContact["Email"] = user.Email; customerContact.SaveChanges(); }
Hi,
Looking for a quick suggestion and confirmation.
We are doing an MVP site for a client base on http://commerce75.demo.episerver.com/ version 7.5.394.2.
Where Client is looking for their AD Users to use the Wishlist functionality. That didn't work, It is working fine for SQL Users. I investigated further and found CartHelper class is taking Contact From OrderContext Classes and for AD Users every time we are getting a new Contact ID for AD Users (AD Users doesnot have a Contact created).
We need to find some best solution for AD users.
My first option will be to create a contact object for a AD Users whenever it gets login.
OR write CustomCartHelper class to meet with custom requirement in any case I will require to creae a contact object for AD Users.
Regards
Khurram