Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Original carts missing in CartMergedEvent #2160

Closed
dafen opened this issue Nov 2, 2021 · 1 comment
Closed

Original carts missing in CartMergedEvent #2160

dafen opened this issue Nov 2, 2021 · 1 comment
Labels

Comments

@dafen
Copy link

dafen commented Nov 2, 2021

PHP Version

All

Shopware Version

^6.4.x

Expected behaviour

The CartMergedEvent should contain the original carts (customer cart and guest cart with their tokens) and the new merged cart and not just two instances of the merged cart.

Also the guestCart get's removed, so when managing carts / order over api there is no way to keep the reference of the cart. (or know what happend to the cart)
https://github.com/shopware/platform/blob/trunk/src/Core/System/SalesChannel/Context/SalesChannelContextRestorer.php#L113

Actual behaviour

The event contains the merged and original cart, but actually these object are just identical (apart from the line items, but the new lines items could also be calculated by comparing the merged and guest cart), so no real value is added by passing $cartClone, instead the guest cart should also be available.

How to reproduce

Produce a cart over the api, give the cart to your session (by setting the cart token to the session and creating a sales_channel_api_context instance).

Open checkout, see the cart created by API, then log in. Cart will now be merged with the previous cart thus talking the token from the customers cart. the (guest) cart created via api will be deleted without any reference. trying to patch this cart or getting it's information from my third party is now impossible as the cart is gone and there is no way to know which new cart / order has been created from that cart. (no history of token changes)

Related: #1923

@dafen dafen added the Bug label Nov 2, 2021
@shyim shyim closed this as completed Aug 18, 2022
@shyim
Copy link
Member

shyim commented Aug 18, 2022

Its fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants