magento / magento/community-features
Updating a cart item via REST API with quantity 0 should remove the cart item
- Dominant language
- No language data
- Stars
- 46
- Forks
- 14
- PR merge metrics
- No merged PRs in 30d
Description
Updating a cart item via REST API with quantity 0 should remove the item from the quote. But instead it is always set to 1?
### Preconditions
1. Magento 2.2 CE
### Steps to reproduce
1. Create quote for guess user via REST API
2. Add product with quantity > 1
3. Update cart item with `PUT /rest/V1/guest-carts/CART_ID/items/ITEM_ID` and use `"qty": 0` as part of body.
### Expected result
1. Cart item should be removed from quote
### Actual result
1. Cart item quantity is always set o 1, independently for the value before
**Original Report**: https://github.com/magento/magento2/issues/16214 by @mhaack
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the guest-cart request at PUT /rest/V1/guest-carts/CART_ID/items/ITEM_ID with an item quantity of 0 in Magento 2.2. Verify that the current behavior changes the quantity to 1; the fix is complete when the cart item is removed from the quote instead.
Written by the indexing model from the issue text.
Assessment
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100