Closed
Description
Preconditions (*)
- Magento 2.3 from the latest
magento/graphql-ce/2.3-develop
Steps to reproduce (*)
- Create 2 Configurable products SKU's: [sku-c1, sku-c2]
- Add 1 super attribute option, etc. Color - Red
- Create 1 variation with attribute Color -Red for each product SKU's:[sku-c1-Red, sku-c2-Red]
Don't forget fill out quantity and add all products to the category.
- Create empty cart
- Run mutation with the wrong parent SKU.
mutation {
addConfigurableProductsToCart(
input:{
cart_id:"NEW_CART_ID"
cart_items:{
parent_sku: "sku-c1"
data:{
sku:"sku-c2-Red"
quantity:1
}
}
}
) {
cart {
items {
id
quantity
product {
sku
}
... on ConfigurableCartItem {
configurable_options {
id
option_label
value_id
value_label
}
}
}
}
}
}
Expected result (*)
- Error is thrown.
Actual result (*)
I'm not sure whether it is bug or feature. Magento automatically selects the correct child product according to the super attribute. Consider this and unmark/fix the folowing test \Magento\GraphQl\ConfigurableProduct\AddConfigurableProductToCartTest::testAddVariationFromAnotherConfigurableProductWithTheSameSuperAttributeToCart
added in PR magento/graphql-ce#866.