Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ldc321 opened this issue May 8, 2020 · 7 comments · May be fixed by #31018
Open

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

ldc321 opened this issue May 8, 2020 · 7 comments · May be fixed by #31018
Assignees
Labels
Component: Webapi Use with concrete module component label E.g. "Component: Webapi" + "Catalog" feature request Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: PR in progress Progress: ready for grooming Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it
Milestone

Comments

@ldc321
Copy link

ldc321 commented May 8, 2020

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
@m2-assistant
Copy link

m2-assistant bot commented May 8, 2020

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

@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label May 8, 2020
@ldc321
Copy link
Author

ldc321 commented May 8, 2020

My English is poor, I'm sorry

@shikhamis11 shikhamis11 self-assigned this May 8, 2020
@m2-assistant
Copy link

m2-assistant bot commented May 8, 2020

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.

@shikhamis11 shikhamis11 added Component: Catalog Component: Webapi Use with concrete module component label E.g. "Component: Webapi" + "Catalog" Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed labels May 13, 2020
@ghost ghost unassigned shikhamis11 May 13, 2020
@magento-engcom-team
Copy link
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.

@magento-engcom-team magento-engcom-team added the Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development label May 13, 2020
@ProkopovVitaliy
Copy link
Contributor

I'm working on this issue.

@naydav
Copy link
Contributor

naydav commented May 20, 2020

Guys,
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.

cc: @sdzhepa

@sdzhepa sdzhepa added the Triage: Ready for Triage Issue is ready to me triaged with Product Manager label Jun 8, 2020
@ghost ghost unassigned ProkopovVitaliy Aug 10, 2020
@sdzhepa sdzhepa added Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it and removed Triage: Ready for Triage Issue is ready to me triaged with Product Manager labels Aug 13, 2020
@sdzhepa sdzhepa added Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Severity: S2 Major restrictions or short-term circumventions are required until a fix is available. labels Sep 8, 2020
@sivaschenko sivaschenko changed the title Rest api update cart item error! Introduce separate POST and PUT API for carts/mine/items Sep 8, 2020
@sivaschenko sivaschenko added the CD Issue recommended for the contribution day label Oct 7, 2020
@gabrieldagama gabrieldagama added this to the 2.5 milestone Nov 23, 2020
@engcom-Bravo engcom-Bravo removed CD Issue recommended for the contribution day Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Component: Catalog Severity: S2 Major restrictions or short-term circumventions are required until a fix is available. Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed labels Apr 15, 2025
@engcom-Bravo
Copy link
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.

@engcom-Bravo engcom-Bravo added feature request and removed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed labels Apr 15, 2025
@ct-prd-projects-boards-automation ct-prd-projects-boards-automation bot added Progress: ready for grooming and removed Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch labels Apr 15, 2025
@engcom-Bravo engcom-Bravo moved this to In Progress in Feature Requests Backlog Apr 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Webapi Use with concrete module component label E.g. "Component: Webapi" + "Catalog" feature request Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: PR in progress Progress: ready for grooming Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it
Projects
Status: In Progress
Development

Successfully merging a pull request may close this issue.

10 participants