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

Cart quantity can be inconsistent #391

Closed
mikkamp opened this issue Mar 12, 2024 · 0 comments · Fixed by #421
Closed

Cart quantity can be inconsistent #391

mikkamp opened this issue Mar 12, 2024 · 0 comments · Fixed by #421
Labels
type: bug The issue/PR is a confirmed bug. v2.0.0 Related to version >= 2.0.0

Comments

@mikkamp
Copy link
Contributor

mikkamp commented Mar 12, 2024

Describe the bug:

This is a followup from #386

We search for products in the cart items first and then the list of products, see here.

That's a problem when it comes to the quantity number, which we can see in the following scenario:

  1. Add single product 3x to cart
  2. Refresh archive page
  3. Add same single product to cart
  4. View tracking data and the quantity is set to 3

Ideally we should be setting the quantity back to 1. Also is it really relevant to search through cart data, even though the product ID matches, we might have added one with a discount / addon which could make the price different. We'll need to log this in a separate issue.

Steps to reproduce:

  1. Setup extension for tracking add to cart events
  2. Create a simple product
  3. Create a page with the [products] shortcode
  4. In an incognito window visit the archive page
  5. Add the single product to the cart 3 times
  6. Confirm each event is tracked for a single quantity being added
  7. Refresh the archive page
  8. Add the same single product to the cart
  9. Confirm the event now has a quantity of 3 (even though we are adding the 4th item)

Expected behavior:

The quantity always to be tracking the amount we are adding to the cart
The product price to be reflective of the cart item we are adding, and not a previously stored value of the product price

@puntope puntope added type: bug The issue/PR is a confirmed bug. v2.0.0 Related to version >= 2.0.0 labels Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug The issue/PR is a confirmed bug. v2.0.0 Related to version >= 2.0.0
Projects
None yet
2 participants