primaryaddress issue adding login to onepagecheckout
Posted: Mon Aug 16, 2010 8:58 am
Hi,
When adding login capabilities to the one page checkout I discovered that somewhere an address with all nulls is being created. During the login when the anonymous user is migrated over to the authenticated user it seems to take this new address with it and store the new (all null) address as the primary address. I've tried manually setting the primaryaddress:
Token.Instance.User.PrimaryAddressId = loginUser.PrimaryAddressId;
That didn't work. I also tried clearing out the anon user's address before migration:
User thisuser = Token.Instance.User;
thisuser.Addresses.DeleteAll();
thisuser.PrimaryAddressId = 0;
thisuser.Save();
Obviously that didn't work either or I wouldn't be posting here. I can't find another forum post about this issue.
-Tim
When adding login capabilities to the one page checkout I discovered that somewhere an address with all nulls is being created. During the login when the anonymous user is migrated over to the authenticated user it seems to take this new address with it and store the new (all null) address as the primary address. I've tried manually setting the primaryaddress:
Token.Instance.User.PrimaryAddressId = loginUser.PrimaryAddressId;
That didn't work. I also tried clearing out the anon user's address before migration:
User thisuser = Token.Instance.User;
thisuser.Addresses.DeleteAll();
thisuser.PrimaryAddressId = 0;
thisuser.Save();
Obviously that didn't work either or I wouldn't be posting here. I can't find another forum post about this issue.
-Tim