Open
Description
Preconditions and environment
- Magento 2.4.8
- Native M2 with Sample data installed
Steps to reproduce
- create an empty cart
mutation {
createGuestCart {
cart {
id
}
}
}
- add a product by specifying parent_sku following the official doc
mutation {
addProductsToCart(
cartId: "LclKxxxxxxxxxxxxxxW"
cartItems: [
{
quantity: 1
parent_sku: "WSH12"
sku: "WSH12-28-Green"
}
]
) {
cart {
itemsV2 {
items {
id
product {
name
sku
}
quantity
}
total_count
page_info {
page_size
current_page
total_pages
}
}
}
user_errors {
code
message
}
}
}
Expected result
{
"data": {
"addProductsToCart": {
"cart": {
"itemsV2": {
"items": [
{
"id": "24",
"product": {
"name": "Erika Running Short",
"sku": "WSH12"
},
"quantity": 1
},
{
"id": "26",
"product": {
"name": "Erika Running Short-28-Green",
"sku": "WSH12-28-Green"
},
"quantity": 1
}
],
"total_count": 2,
"page_info": {
"page_size": 20,
"current_page": 1,
"total_pages": 1
}
}
},
"user_errors": []
}
}
}
Actual result
{
"data": {
"addProductsToCart": {
"cart": {
"itemsV2": {
"items": [
{
"id": "18",
"product": {
"name": "Erika Running Short-28-Green",
"sku": "WSH12-28-Green"
},
"quantity": 1
}
],
"total_count": 1,
"page_info": {
"page_size": 20,
"current_page": 1,
"total_pages": 1
}
}
},
"user_errors": []
}
}
}
Additional information
When we use the other way it works as expected.
The main problem is the cart doesn't contain the configurable product which leads to issues.
Release note
[GraphQL] - fix addProductsToCart when specifying parent_sku to work as expected
Triage and priority
- Severity: S0 - Affects critical data or functionality and leaves users without workaround.
- Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
- Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
- Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
- Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Ready for Development