Copied to clipboard

Flag this post as spam?

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


  • James 1 post 21 karma points
    Jan 05, 2015 @ 16:38
    James
    0

    Anonymous Basket -> Signed in member... Basket Empty

    I've been having an issue getting items in the basket to persist when a member user signs in.

    If I add items to the basket as an anonymous user and then sign in as a member, the basket is then empty.

    I spent a while digging through the code and debugging and think I've tracked down the problem.

    There is code to detect when a member signs in and convert the basket from anonymous to the signed in member, but it fails.

    In the BasketConversionByCombiningAnonymousBasket class in Merchello.Web there's a procedure called Merge which contains a line to add items from the anonymous basket to the customer basket:

    CustomerBasket.Items.Add(AnonymousBasket.Items.Select(x => x.AsLineItemOf<IItemCacheLineItem>()));

    This fails when it tries to enumerate the items using AsLineItemOf.

    The problem seems to be passing the type IItemCacheLineItem, which is an interface, as the code then tries to use ActivatorHelper to create a new instance of IItemCacheLineItem, but as that's an interface it fails.

    I think it should be passing type ItemCacheLineItem instead of interface IItemCacheLineItem.

    I've had a play about and that does seem to fix the problem, so I was wondering if anybody else has had any experience with this?

    James

  • Martin 81 posts 246 karma points
    Jan 05, 2015 @ 17:14
    Martin
    0

    Yup, see my last post in this thread http://our.umbraco.org/projects/collaboration/merchello/merchello/59972-Basket-is-empty-after-restart

    I have the same issue as you. I had an issue with my Merchello installation so there was the possibility it was an issue purely on my end, however, if you're experiencing it too it seems like an actual bug. Desperately need a resolution to this as all customers have to sign in / register in my store.

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    Jan 06, 2015 @ 00:17
    Rusty Swayne
    0

    @James - you are exactly right. We need to change this to an ItemCacheLineItem instead of an interface. I'll get that updated.

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    Jan 06, 2015 @ 00:19
Please Sign in or register to post replies

Write your reply to:

Draft