ExternalAuthorizer.cs Add migrate shopping cart code for new customers. All version.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
9 yıl önce
Guest added product to cart and pressed LogIn in Facebook authentication module. He has empty cart.

ExternalAuthorizer.cs
method
public virtual AuthorizationResult Authorize(OpenAuthenticationParameters parameters)

old code


//code below is copied from CustomerController.Register method

//authenticate
if (isApproved)
   _authenticationService.SignIn(userFound ?? userLoggedIn, false);


new code

//code below is copied from CustomerController.Register method
//authenticate
if (isApproved)
{
     //migrate shopping cart
    _shoppingCartService.MigrateShoppingCart(_workContext.CurrentCustomer, userFound ?? userLoggedIn, true);

   _authenticationService.SignIn(userFound ?? userLoggedIn, false);
}


In CustomerController.Register method we have migrate shopping cart code.
9 yıl önce
Hi,

Thanks a lot for reporting. I've just created a work item
9 yıl önce
I've just tried to reproduce it. It works fine.

When auto registration is enabled, then the current (same) customer record is used. So in this case shopping cart migration is not required.

In other cases _shoppingCartService.MigrateShoppingCart is already invoked in "Authorize" method of "ExternalAuthorizer"
9 yıl önce
Yes, you are right.
I have verified code too. Customer will have the same ID after registration...

Sorry for disturbing.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.