Closed WHITE-developer closed 1 month ago
Hi @WHITE-developer
Thanks for reporting, we have pushed a fix for this which will be included in the next release of Commerce 4.x.
For reference, the priority order for restoring carts is as follows:
Thanks!
Commerce 4.6.1
and 5.0.7
have been released with this fix.
What happened?
Description
Don't know if the logic for restoring a previous cart is correct. For example: you have items in your cart when you were logged in. If you are logged out and are going to shop at a later time and add (other) items in you cart, when you log in, you're current cart is being replaced with your old cart when you were logged in before.
Don't think this is the best logic. Because you want to shop the items you have in your cart at that moment, not the ones from an earlier time. Best would be to merge the carts? Or at least get the last cart you have added items to.
Steps to reproduce
Expected behavior
You would expect the item added in 1. to be in the cart.
Actual behavior
Cart has only the item from previous saved cart.
Craft CMS version
4.9.1
Craft Commerce version
4.6.0
PHP version
8.3.4
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions
-