Copied to clipboard

Flag this post as spam?

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


  • Tito 284 posts 496 karma points
    Dec 10, 2015 @ 18:31
    Tito
    0

    Problem with CustomerContext in Basket controller

    I have a problem with the basket controller. In my project i am using the code from bazaar's basket controller. It throws an error when saving the basket. I have added Merchello source to the project and it throws the exception in the CustomerContext class, in this method:

    protected override void EnsureCustomerCreationAndConvertBasket(ICustomerBase customer)
            {
                if (!customer.IsAnonymous) return;
    
                var memberId = Convert.ToInt32(this.MembershipProviderKey(customer.Key));
                var member = _memberService.GetById(memberId);
    
                if (MerchelloConfiguration.Current.CustomerMemberTypes.Any(x => x == member.ContentTypeAlias))
                {
                    base.EnsureCustomerCreationAndConvertBasket(customer);
                }
            }
    

    memberId=-1, so member=null and throws a null exception.

    I have created a "Customer" membertype. I dont know if i have to configure something else, maybe in merchello.config?

  • Tito 284 posts 496 karma points
    Dec 14, 2015 @ 12:32
    Tito
    0

    It seems solved installing Merchello 1.13.2

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies