magento2
magento2 copied to clipboard
Item should be updated if there is a buyRequest
Fixes #35907
Hi @pmzandbergen. Thank you for your contribution Here are some useful tips how you can test your changes using Magento test environment. Add the comment under your pull request to deploy test or vanilla Magento instance:
@magento give me test instance- deploy test instance based on PR changes@magento give me 2.4-develop instance- deploy vanilla Magento instance
:exclamation: Automated tests can be triggered manually with an appropriate comment:
@magento run all tests- run or re-run all required tests against the PR changes@magento run <test-build(s)>- run or re-run specific test build(s) For example:@magento run Unit Tests
<test-build(s)> is a comma-separated list of build names. Allowed build names are:
Database CompareFunctional Tests CEFunctional Tests EE,Functional Tests B2BIntegration TestsMagento Health IndexSample Data Tests CESample Data Tests EESample Data Tests B2BStatic TestsUnit TestsWebAPI TestsSemantic Version Checker
You can find more information about the builds here
:information_source: Run only required test builds during development. Run all test builds before sending your pull request for review.
For more details, review the Magento Contributor Guide documentation.
:warning: According to the Magento Contribution requirements, all Pull Requests must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.
:clock10: You can find the schedule on the Magento Community Calendar page.
:telephone_receiver: The triage of Pull Requests happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.
:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel
@magento run all tests
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.
@magento run Functional Tests EE
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.
https://github.com/magento run Functional Tests EE
@magento run Functional Tests EE
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.
@magento run Functional Tests EE
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.
:heavy_check_mark: QA Passed
Preconditions: Install fresh Magento.
Manual testing scenario:
1.Create admin token using endpoint: /rest/default/V1/integration/admin/token/
Payload
{
"username": "admin",
"password": "admin@123"
}
Using admin token you can use in header as bearer token.
-
Create a empty cart(post) in rest api endpoint:
/index.php/rest/V1/guest-carts/It will give you cart id in response -
Using post method add product to cart(configurable product): `/rest/V1/guest-carts/{cartid}/items Payload
{
"cartItem": {
"sku": "config_test",
"qty": 1,
"quote_id": "21",(take from DB)
"product_option": {
"extension_attributes": {
"configurable_item_options": [
{
"option_id": "93",
"option_value": 4
}
]
}
},
"extension_attributes": {}
}
}
In response you will get item id
4. Using put method update cart /rest/V1/guest-carts/RutltjLiQzylAEu8L1jsHBI7YS58qWp7/items/{itemid}
{
"cartItem": {
"sku": "config_test",
"qty": 1,
"quote_id": "21",
"product_option": {
"extension_attributes": {
"configurable_item_options": [
{
"option_id": "93",
"option_value": 5
}
]
}
},
"extension_attributes": {}
}
}
Before: :heavy_multiplication_x: Cart was not getting updated

After: :heavy_check_mark: Cart items got updated.

Hence, moving it to MIP
Thanks
@pmzandbergen Could you please resolve merge conflict
@Den4ik it seems @mahesh-singh-rajawat fixed it with AC-5986: https://github.com/magento/magento2/commit/eb02e7a4715169bc24261159da9bb0573fdb0ab2
I guess we could close this PR.
@pmzandbergen Yep, it's already fixed. Thanks for your work