Skip to content
Advertisement

How to update cart quantity if item already exist in Cart – reactjs?

in this code, instead of showing “The product has been added to cart.” alert message, I want to update cart quantity if item already exist in cart, please help me out.

JavaScript

Advertisement

Answer

I am making some assumptions here as to what your variables look like, but generally, here is what you need:

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement