vuestorefront-community / odoo

https://docs.vuestorefront.io/odoo/
MIT License
66 stars 26 forks source link

[Bug]: Add to cart an item that is already in cart #41

Closed SullyAnn closed 1 year ago

SullyAnn commented 2 years ago

Expected Behavior

In the product page when we try to add twice the same product in the cart it's supposed to increment the number of product in the cart.

Actual Behavior

It does not do anything, the button not even send the request

Possible Solution

In the function addItem We removed the line if (!params.isInCart(context, { currentCart, product })) It seems to work without this line.

Steps to reproduce

  1. In the product page add to cart a product by clickin on the button
  2. In the product page add to cart the same product again by clicking on the call to action button
  3. Now you should be able to see in the cart that you still have one item

What version of odoo integration are you using?

14.0

What version of Node.js are you using?

v12.22.12

What browser (and version) are you using?

Chrome version 101.0.4951.64

What operating system (and version) are you using?

Linux

Relevant log output

No response

Code of Conduct

odranoelBR commented 1 year ago

@SullyAnn it depents of the appllications needs. Some clients want this behaviour, not increase a product. we have an update that, make the cart sidebar open when the "twice" effect happens. If you need it, you can ovveride useCart composable, and on the else of if(!params...) you can update quantity too. Tks