You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello.
If I buy a product, I select quantity 2 and click Add to Cart button, il will appears 2 products at the bag. Ok it works great.
But if I decide to buy another product. I click another product and it keeps the same quantity value of the first product. I need to change the value quantity to chose just 1 product.
Does it happen with you too?
The text was updated successfully, but these errors were encountered:
Hello. If I buy a product, I select quantity 2 and click Add to Cart button, il will appears 2 products at the bag. Ok it works great. But if I decide to buy another product. I click another product and it keeps the same quantity value of the first product. I need to change the value quantity to chose just 1 product. Does it happen with you too?
It's supposed to do that. and it's because of the way we've set the quantity, inside stateContext we change the quantity to what we want with the plus and minus options on the product page, and it is not reset when we add the item to the cart.
If you want to reset that, you will have to reset the qty, with setQty method.
If you want to reset after adding items to the cart, u have to put it inside the event handler of the cart button.
If you wanna do that if you move to some other product page, then I think you can use the useEffect hook.
Hello.
If I buy a product, I select quantity 2 and click Add to Cart button, il will appears 2 products at the bag. Ok it works great.
But if I decide to buy another product. I click another product and it keeps the same quantity value of the first product. I need to change the value quantity to chose just 1 product.
Does it happen with you too?
The text was updated successfully, but these errors were encountered: