Skip to content

Introduce separate POST and PUT API for carts/mine/items #28162

@ldc321

Description

@ldc321

Description

Currently, there is no way to set exact number of cart items. The POST request is adding posted quantity to existing quantity in the cart. The idea is to introduce ability to rewrite the items with PUT request

Steps to reproduce (*)

70096:ItemId already exists and qty=3
can{{t update cart items when set Maximum Qty Allowed in Shopping Cart
1.POST:http://xxxxxx.com/rest/V1/carts/mine/items
2.body:{"cartItem":{"sku":"AM-OL-I3T-CA-OS","qty":4,***"item_id":70096,_**"quoteId":"3xxx45","product_option":{"extension_attributes":{"custom_options":<],"configurable_item_options":[{"option_id":"93","option_value":"66"}],"bundle*options":[>}}}}
3.set Maximum Qty Allowed in Shopping Cart=6

If I do post, I get an error:The requested qty exceeds the maximum qty allowed in shopping cart
tips: If oldQty is 3, postQty is 2, final qty is 2, there is no problem!
if oldQty is 3, postQty is 4, I get an error:The requested qty exceeds the maximum qty allowed in shopping cart

Expected result (*)

Update: after review this issue expected result was updated #28162 (comment)

Desire state should be
POST }}carts/mine/items- add item(s). If called several times - increment Qty PUT carts/mine/items` - add item(s). If called several times - each time overwrite previously created item.

  1. I want to change the qty of products in the cart 3 to 4
  1. It should be overwrite, not increment

Actual result (*)

  1. I get an error:The requested qty exceeds the maximum qty allowed in shopping cart

Activity

m2-assistant

m2-assistant commented on May 8, 2020

@m2-assistant

Hi @ldc321. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • Summary of the issue
    Information on your environment
    Steps to reproduce
    Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, please, review the Magento Contributor Assistant documentation.

@ldc321 do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • yes
    no

ldc321

ldc321 commented on May 8, 2020

@ldc321
Author

My English is poor, I'm sorry

self-assigned this
on May 8, 2020
m2-assistant

m2-assistant commented on May 8, 2020

@m2-assistant

Hi @shikhamis11. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

    2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

    3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

    4. Verify that the issue is reproducible on 2.4-develop branch

    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

    5. Add label Issue: Confirmed once verification is complete.

    6. Make sure that automatic system confirms that report has been added to the backlog.

added
Component: WebapiUse with concrete module component label E.g. "Component: Webapi" + "Catalog"
Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branch
Issue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmed
on May 13, 2020
Repository owner unassigned on May 13, 2020
magento-engcom-team

magento-engcom-team commented on May 13, 2020

@magento-engcom-team
Contributor

✅ Confirmed by @shikhamis11
Thank you for verifying the issue. Based on the provided information internal tickets MC-34298 were created

Issue Available: @shikhamis11, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

32 remaining items

removed
CDIssue recommended for the contribution day
Issue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for development
Severity: S2Major restrictions or short-term circumventions are required until a fix is available.
Issue: Format is not validGate 1 Failed. Automatic verification of issue format is failed
on Apr 15, 2025
engcom-Bravo

engcom-Bravo commented on Apr 15, 2025

@engcom-Bravo
Contributor

Hi @ldc321,

Thanks for your reporting and collaboration.

After going through with the description it will be an new feature to proceed further marking this as Feature Request.

Thanks.

added and removed
Issue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmed
on Apr 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Component: WebapiUse with concrete module component label E.g. "Component: Webapi" + "Catalog"Priority: P2A defect with this priority could have functionality issues which are not to expectations.Progress: PR in progressProgress: ready for groomingTriage: Dev.ExperienceIssue related to Developer Experience and needs help with Triage to Confirm or Reject itfeature request

Type

No type

Projects

Status

In Progress

Relationships

None yet

    Participants

    @naydav@sivaschenko@gabrieldagama@sdzhepa@shikhamis11

    Issue actions

      Introduce separate POST and PUT API for carts/mine/items · Issue #28162 · magento/magento2