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

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

Closed
elivz opened this issue Apr 3, 2024 · 5 comments
Closed

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

elivz opened this issue Apr 3, 2024 · 5 comments
Assignees
Labels
bug commerce4 Issues related to Commerce v4 Craft Commerce

Comments

@elivz
Copy link

elivz commented Apr 3, 2024

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

  • Line items added before logging in should still be present in the cart.

Actual behavior

  • The cart is empty

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

@elivz elivz added bug commerce4 Issues related to Commerce v4 Craft Commerce labels Apr 3, 2024
Copy link

linear bot commented Apr 3, 2024

@WHITE-developer
Copy link

Guess it got broken in this commit (4.3.3)

@CrystalHolmes
Copy link

any updates on this @lukeholder ?

@nfourtythree
Copy link
Contributor

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
Copy link
Contributor

This fix has now be released as part of Commerce 4.5.4

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug commerce4 Issues related to Commerce v4 Craft Commerce
Projects
None yet
Development

No branches or pull requests

5 participants