8 thoughts on “Persistent Cart for Anonymous Users

  1. Do you need to also set the following configuration properties in order for the cart to be persisted:

    # Settings for persisting shoppingCart for logged in users
    persistOrders=true

    # Setting for persisting shopping cart of anonymous users
    persistOrdersForAnonymousUsers=true

  2. What would a SQL look like if I am trying to remove order from db. I ask because I have millions of records created that causes out of memory error on app server.

  3. This is not easy, especially if you have any extensions to the order repository item. What I usually do is write a Java service that gets all the orders that fit a certain criteria from the repository and then delete them.

  4. David you are correct but honestly I’ve never used those settings. I’d have to look at the code to see what they do. I’ve actually moved away from persisting orders for anonymous users using this mechanism and instead moved to a different method. I’ll need to write a post about that. 🙂

  5. Frank,

    I ended up going with a pure cookie based solution for both anonymous and registered users on the site. So now the only thing that gets persisted to the orders table are true orders. I created a Cart Restore servlet to run in the pipeline, only runs once per session. Then made modifications to the cookie manager long with overriding update order. So far working pretty good.

    I was taking a look at Hybris the other day and what they have is a cart table and a order table. So they keep these items completely separate which I think makes a nice clean design and data view as well

  6. David,
    Your solution sounds something like mine, maybe a lot better. 🙂
    That is interesting about Hybris. Hadn’t heard about that platform until now.

Leave a Reply

Your email address will not be published. Required fields are marked *