Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Simon Dingley 1470 posts 3427 karma points c-trib
    Sep 01, 2017 @ 11:19
    Simon Dingley
    0

    Reinitialize CustomerContext - Customer Remains Anonymous

    I am trying to create a customer as part of the same process where the customer enters their billing details. I look up the email and if there is already a customer with the same email I prompt the user to log in and if not there is a password field shown which will be shown to create a new account.

    In my controller (which inherits from CheckoutAddressControllerBase) I am creating a new MembershipUser using the standard Umbraco MembershipHelper and the RegisterMember method. Once the user is created I also log them in using the Login method. The cart contents are persisted now which is great and the user us logged in successfully, however, the CustomerContext still shows an anonymous customer despite calling CustomerContext.Reinitialize(customer). This results in the next step of my checkout process failing because the CheckoutManager is still referencing the anonymous customer.

    Any ideas why the CustomerContext is not updated?

    Thanks, Simon

Please Sign in or register to post replies

Write your reply to:

Draft