Sylius: Unexpected cart attached to customer on login

Created on 4 Aug 2017  路  8Comments  路  Source: Sylius/Sylius

There is (IMHO) undesired behavior when adding something to the cart and then logging in - essentially customer gets unexpected cart.

Steps to reproduce:

  1. As logged in user add something to the cart, logout without finishing order
  2. Come back to site (not logged in) add something to the cart
  3. Log in and then your cart will be old cart you "created" in step 1

I don't think customers would expect this.

I think solution is simple (if we agree that this is a problem):

priorities of sylius.context.cart.session_based and sylius.context.cart.customer_and_channel_based should be switched so session based cart is first in priority queue.
(I tested this approach and it seams to work, not 100% sure if there are any unwanted consequences to this solution)

Do not stale Documentation RFC Roadmap

Most helpful comment

I experienced the same thing and felt it was an undesired behavior. Rather than keep only the session based cart, what would you think about merging the old (session based cart) and the new one (customer and channel based cart) together ? Maybe some listener could handle that, but I didn't try anything yet.

All 8 comments

I experienced the same thing and felt it was an undesired behavior. Rather than keep only the session based cart, what would you think about merging the old (session based cart) and the new one (customer and channel based cart) together ? Maybe some listener could handle that, but I didn't try anything yet.

Hey @blankcheck, In our opinion you should customize priority in your project. /cc @Sylius/core-team

There is no silver bullet for this problem.

@blankcheck with this solution imagine one computer with two users. You have put something in your cart, then log out, somebody came to your computer add something else, then leave, then you want to log in and you have a different cart.

@regnisolbap merging can be confusing for others as well.

I would vote to document how to make this customization but leave the current implementation.

I'm totally 馃憤 for documenting customization. It's really specific to shop how it should be resolved and we should focus to deliver the basic functionality, which would be easy to customize 馃悆

I attach to the next milestone because it is not a blocker for the release, we just need to document it.

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in a week if no further activity occurs. Thank you for your contributions.

I would vote for leaving this open, as documentation is still needed :)

Documented in #10167
Requires further documentation in a form of "Cart Flow customization guide", creating a separate issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

loic425 picture loic425  路  3Comments

mikemix picture mikemix  路  3Comments

igormukhingmailcom picture igormukhingmailcom  路  3Comments

stefandoorn picture stefandoorn  路  3Comments

reyostallenberg picture reyostallenberg  路  3Comments