-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Open
Labels
Area: Cart & CheckoutComponent: GraphQLGraphQLGraphQLIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P2A defect with this priority could have functionality issues which are not to expectations.A defect with this priority could have functionality issues which are not to expectations.Reported on 2.4.xIndicates original Magento version for the Issue report.Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchThe issue has been reproduced on latest 2.4-develop branch
Description
This issue is automatically created based on existing pull request: #40248: Call RemoveItem on cart instead of ItemRepository
Description (*)
This PR replaces the deleteById calls on the CartItemRepository with removeItem on the cart instance.
This makes sure expected observers are triggered and the item is actually updated on the cart object as well, instead of in the database only.
This fixes a case where if you mass remove items using updateCartItems only a single item is removed in the response.
Manual testing scenarios (*)
- Add multiple products to the cart
- remove the products with the following query
mutation updateCart($input: UpdateCartItemsInput) {
updateCartItems(input: $input) {
cart {
items {
uid
}
}
}
}
{
"input": {
"cart_id": "xxxx",
"cart_items": [
{
"cart_item_id": "xx",
"quantity": 0
},
{
"cart_item_id": "xx",
"quantity": 0
},
{
"cart_item_id": "xx",
"quantity": 0
},
{
"cart_item_id": "xx",
"quantity": 0
},
{
"cart_item_id": "xx",
"quantity": 0
}
]
}
}
- Observe how items still appear to be in the cart until you manually request the cart again.
- Repeat these steps after applying this PR
- Observe how all selected items have immediately disappeared from the response.
Contribution checklist (*)
- Pull request has a meaningful description of its purpose
- All commits are accompanied by meaningful commit messages
- All new or changed code is covered with unit/integration tests (if applicable)
- README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
- All automated tests passed successfully (all builds are green)
Metadata
Metadata
Assignees
Labels
Area: Cart & CheckoutComponent: GraphQLGraphQLGraphQLIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P2A defect with this priority could have functionality issues which are not to expectations.A defect with this priority could have functionality issues which are not to expectations.Reported on 2.4.xIndicates original Magento version for the Issue report.Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchThe issue has been reproduced on latest 2.4-develop branch
Type
Projects
Status
Ready for Development