You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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)
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
The text was updated successfully, but these errors were encountered: