-
Notifications
You must be signed in to change notification settings - Fork 9.4k
GraphQL cannot add product with customizable option to cart #37599 #37652
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
GraphQL cannot add product with customizable option to cart #37599 #37652
Conversation
Hi @shomiadarshlt. Thank you for your contribution! Add the comment under your pull request to deploy test or vanilla Magento instance:
❗ Automated tests can be triggered manually with an appropriate comment:
Allowed build names are:
You can find more information about the builds here For more details, review the Code Contributions documentation. |
@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 message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues. |
…_product_options_37599-bugfix
https://github.com/magento run all tests |
@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 message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues. |
@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 message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues. |
This PR already merged and shouldn't have pending review status |
Description (*)
Related Pull Requests
Fixed Issues (if relevant)
Manual testing scenarios (*)
Go to admin panel > Catalog > Products
Create a simple product (Joust Duffle bag)
Create a custom option for Joust Duffle Bag
Create a empty cart using graphql
mutation {
createEmptyCart
}
Get product options information
{
products(filter: {sku: {eq: "24-MB01"}}) {
items {
uid
name
sku
__typename
... on CustomizableProductInterface {
options {
title
required
sort_order
uid
... on CustomizableFieldOption {
textField: value {
sku
price
}
}
... on CustomizableDropDownOption {
dropDown: value {
sku
price
}
}
}
}
}
}
}
Add product to cart using custom option
mutation {
addProductsToCart(
cartId: "62zbf0JBpn9s3U7C2iIze2sWidmMU6Es"
cartItems: [
{
quantity: 1
sku: "24-MB01"
entered_options: [{
uid: "Y3VzdG9tLW9wdGlvbi8y"
value: "test"
}]
}
]
) {
cart {
items {
product {
name
sku
}
... on SimpleCartItem {
customizable_options {
customizable_option_uid
label
values {
customizable_option_value_uid
value
}
}
}
quantity
}
}
user_errors {
code
message
}
}
}
The response will have the array customizable_options fetched with data
{
"data": {
"addProductsToCart": {
"cart": {
"items": [
{
"product": {
"name": "Joust Duffle bag",
"sku": "24-MB01"
},
"customizable_options": [
{
"customizable_option_uid": "Y3VzdG9tLW9wdGlvbi8y",
"label": "test",
"values": [
{
"customizable_option_value_uid": "Y3VzdG9tLW9wdGlvbi8y",
"value": "test"
}
]
}
],
"quantity": 1
}
]
},
"user_errors": []
}
}
}
Questions or comments
Contribution checklist (*)