craftcms / commerce

Fully integrated ecommerce for Craft CMS.
https://craftcms.com/commerce
Other
219 stars 170 forks source link

[4.x]: Cart is wiped out when logging in #3445

Closed elivz closed 5 months ago

elivz commented 6 months ago

Description

It appears that the intended logic that only restored a user's previous cart when logging in if their current cart is empty has gone missing at some point. It is still referenced in a code comment, but I don't see anywhere that would actually implement that. As a result, when logging in after adding items to my cart, the cart is emptied.

Steps to reproduce

  1. Without logging in, add some items to your shopping cart
  2. Log into an existing user account that does not have a previous saved cart

Expected behavior

Actual behavior

Craft CMS version

4.8.6

Craft Commerce version

4.5.3

PHP version

8.1

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

No response

linear[bot] commented 6 months ago

PT-1576 [4.x]: Cart is wiped out when logging in

WHITE-developer commented 5 months ago

Guess it got broken in this commit (4.3.3)

CrystalHolmes commented 5 months ago

any updates on this @lukeholder ?

nfourtythree commented 5 months ago

Hi All

Thank you for bringing this to our attention. We have pushed a fix which will be included in the next release of Commerce.

To get this early, change your craftcms/commerce requirement in your project's composer.json to:

"require": {
  "craftcms/commerce": "dev-develop#e3f9983484db2bb9f7019d6a06fe24ecd4474909 as 4.5.3",
  "...": "..."
}

Then run composer update.

Thanks!

nfourtythree commented 5 months ago

This fix has now be released as part of Commerce 4.5.4

Thanks!