private bool EnsureCartCustomer(ShoppingCartInfo shoppingCart) { CustomerInfo customer = shoppingCart.Customer; customer.CustomerSiteID = shoppingCart.ShoppingCartSiteID; customer.CustomerUserID = shoppingCart.ShoppingCartUserID; CustomerInfoProvider.SetCustomerInfo(customer); shoppingCart.ShoppingCartCustomerID = customer.CustomerID; if (customer.CustomerID > 0) { // Track successful registration conversion string name = ECommerceSettings.RegistrationConversionName(shoppingCart.SiteName); ECommerceHelper.TrackRegistrationConversion(shoppingCart.SiteName, name); // Log customer registration activity var activityCustomerRegistration = new ActivityCustomerRegistration(customer, MembershipContext.AuthenticatedUser, AnalyticsContext.ActivityEnvironmentVariables); if (activityCustomerRegistration.Data != null) { if ((ContactID <= 0) && (customer.CustomerUser != null)) { activityCustomerRegistration.Data.ContactID = ModuleCommands.OnlineMarketingGetUserLoginContactID(customer.CustomerUser); } else { activityCustomerRegistration.Data.ContactID = ContactID; } activityCustomerRegistration.Log(); } return(true); } else { LogError("Save customer action failed", EVENT_CODE_SAVING); return(false); } }