Just in case anybody else runs into the same problem. I found the bug in the Wrox United code that doesn't migrate the Anonymous cart profile to the Authenticated User. In the "Full Application" there is a Global.asax file that migrates the Anonymous user.
EXISTING CODE...
Public Sub Profile_OnMigrateAnonymous(ByVal Sender As Object, ByVal e As ProfileMigrateEventArgs)
' get the profile for the anonymous user
Dim anonProfile As ProfileCommon = Profile.GetProfile(e.AnonymousID)
' if they have a shopping cart, then migrate that to the authenticated user
If anonProfile.Cart IsNot Nothing Then
If Profile.Cart Is Nothing Then
profile.Cart = New Wrox.Commerce.ShoppingCart()
profile.Cart.Items.AddRange(anonProfile.Cart.Items )
end if
anonProfile.Cart = Nothing
End If
ProfileManager.DeleteProfile(e.AnonymousID)
AnonymousIdentificationModule.ClearAnonymousIdenti fier()
End Sub
MODIFIED CODE...
Public Sub Profile_OnMigrateAnonymous(ByVal Sender As Object, ByVal e As ProfileMigrateEventArgs)
' get the profile for the anonymous user
Dim anonProfile As ProfileCommon = Profile.GetProfile(e.AnonymousID)
' if they have a shopping cart, then migrate that to the authenticated user
If anonProfile.Cart IsNot Nothing Then
profile.Cart.Items.AddRange(anonProfile.Cart.Items )
If Profile.Cart Is Nothing Then
profile.Cart = New Wrox.Commerce.ShoppingCart()
profile.Cart.Items.AddRange(anonProfile.Cart.Items )
end if
anonProfile.Cart = Nothing
End If
ProfileManager.DeleteProfile(e.AnonymousID)
AnonymousIdentificationModule.ClearAnonymousIdenti fier()
End Sub
|