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

[Bug]: Same Variant gets added to Cart twice #11745

Open
fxmb opened this issue Mar 6, 2025 · 3 comments
Open

[Bug]: Same Variant gets added to Cart twice #11745

fxmb opened this issue Mar 6, 2025 · 3 comments

Comments

@fxmb
Copy link

fxmb commented Mar 6, 2025

Package.json file

Medusa 2.4.0

Node.js version

20

Database and its version

16

Operating system name and version

Mac

Browser name

No response

What happended?

We experience a bug in V2 (which already existed in V1) that if we add a product to cart, then leave the page, come back and add it again the product is added as 2 different line items. So you have two line items in the end. It should be adding to the first line item. It is the identical variant and product

Expected behavior

Just one line item overall

Actual behavior

Multiple line items for the identical line item

Link to reproduction repo

N/A

@riqwan
Copy link
Contributor

riqwan commented Mar 6, 2025

Hey @fxmb, is this a custom storefront implementation or a starter? If so which one is it?

@fxmb
Copy link
Author

fxmb commented Mar 6, 2025

This is taken from the B2B starter with no changes to the update Cart logic. It also happened in V1 frequently. I suspect a larger underlying issue

@riqwan
Copy link
Contributor

riqwan commented Mar 6, 2025

Thanks @fxmb, can you reproduce it here - https://medusa-b2b-starter.vercel.app/

And send me the cart_id from the cookies? I've tried a few times and can't reproduce it

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

No branches or pull requests

2 participants