iskurbanov/shopify-next.js-tailwind

cart fails to update items according to the variant selected

kevinrobert3 opened this issue · 6 comments

I fetch products with the following variants Color and Size. Adding the first item is no problem. On changing the color variant and leaving the size variant as is, it adds it as an existing item in cart. I don't know if this is the expected behavior. Say the color is green size is 250ml in cart, when i change the color to blue variant and add to cart, it adds to the green variant in cart

Hi Kevin, definitely not expected behavior. Could you share a screenrecording of this issue? Maybe with loom? Thanks!

Did you get the issue

Attaching loom captured from the buildnextshop site too https://www.loom.com/share/11bd5e56030e4cdbace6b3e7e9ac18b1

As you can see, when I add the first product variant, that works, switching the variant to black also works. Switching to white again and adding the item to cart makes two 2 white variants in cart and one 1 other white variant, which is strange and would cause errors in checkout
Also this bug in cart replicates when removing items from cart individually as you can see from the recording

Fixed