Persistent Cart - Overriding current cart

Create issue
Issue #1204 open
Dinh Bowman created an issue

I ran into the problem where if a user has an empty cart and is shopping while not logged in: once logging in, his current cart is overwritten with the empty cart.

I don't believe this is the intended behavior and I also don't necessarily agree that retrieving an old persistent cart should always merge with a non-empty current cart.

I modified a few files to address this issue and have attached a diff. I'm not entirely sure that the Cart.merge_carts() needed me to add a but I did anyways and it is in the patch.

Comments (4)

  1. Dinh Bowman reporter

    I've started a fork (satchmo-dinh) which includes this fix in an attempt to streamline my contributions.

  2. Hynek Cernoch

    Thanks to Bruce. The fix is fixed by a5bd2a536309 .

    The variable PERSISTENT_CART_MERGE is not much helpful. Usefulness of Yes/No does not depend on the shop, but on the user's conditions. Has he repeated product selection yet or has he forgotten, what was in the cart? User should be informed about the merge. The best solution would be to ask the user, if he want to merge carts. ("Do you want to add 3 products for total $123.00 from your old cart?" Yes/No).

    This is not much important.

  3. scrapper

    Hello Bruce, i am sorry for reopening, but i haven't got response from the mailing list nor from satchmo IRC channel.

    Cart merging does not work for me, is it working for you? The new cart overwrites the saved cart... this works. But when i try to do cart merging, both get deleted. And the following message is presented to the user: Your cart is empty.

    Maybe this is only not working for me and i have messed up with my code.

    So thank you guys, thank you Bruce (or Chris or anybody) for your reply!

    greetings sc

  4. Log in to comment