storefront-foundation / react-storefront

React Storefront - PWA for eCommerce. 100% offline, platform agnostic, headless, Magento 2 supported. Always Open Source, Apache-2.0 license. Join us as contributor (contributors@reactstorefront.io).
https://www.reactstorefront.io
Other
796 stars 190 forks source link

Add to Cart functionality issue #202

Open developeryashraj opened 2 years ago

developeryashraj commented 2 years ago

Bug report

Describe the bug

When you click multiple times on "Add to Card" button multiple times. It pushes same product for multiple times in array. Whether it should only update the quantity if product is already in cart.

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Go to https://demo.reactstorefront.io/p/3
  2. Click on 'Add to Card' multiple times. Just close the popup if it opens.
  3. Go to Cart page https://demo.reactstorefront.io/cart
  4. See Multiple entries of same product

Expected behavior

Quantity of the product should get updated in case if it's already in cart and user clicks on "Add to Card"

Screenshots

Product Page

image

Cart Page

image

System information

Additional context

Add any other context about the problem here.