-
Notifications
You must be signed in to change notification settings - Fork 153
GraphQl-143: [Checkout] Add bundled product to Cart #396
GraphQl-143: [Checkout] Add bundled product to Cart #396
Conversation
This allows product type graphql modules a method for managing how inputs are mapped when buy requests are created.
Partial resolution for magento/graphlql-ce#143
Hi, @pmclain. It will be a long-comment). Preconditions:Have a Registered Customer to be able manipulate with a cart from Storefront and from GraphQL Steps to reproduce:
mutation addBundleAndShowProductLinksInfo(
$hasBundles: Boolean = true
) {
addBundleProductsToCart(
input: {
cart_id: "B3TXGWgZ3EqQXCSXRDvlYm38xTzo7MsH"
cartItems: {
bundle_options: {
id: 18
quantity: 2
value: [
"47"
]
}
customizable_options: [
{
id: 6
value: "48"
}
]
data: {
sku: "bundle-product-5"
qty: 2
}
}
}
) {
cart {
items {
__typename
qty
@include(
if: $hasBundles
)
... on BundleCartItem {
bundle_options {
id
label
type
values {
id
label
price
quantity
}
}
customizable_options {
id
type
values {
id
value
}
}
}
product {
__typename
sku
@include(
if: $hasBundles
)
... on BundleProduct {
product_links {
__typename
link_type
linked_product_sku
linked_product_type
}
}
}
}
}
}
}
{
"data": {
"addBundleProductsToCart": {
"cart": {
"items": [
{
"__typename": "BundleCartItem",
"qty": 2,
"bundle_options": [],
"customizable_options": [
{
"id": 6,
"type": "field",
"values": [
{
"id": 120,
"value": "48"
}
]
}
],
"product": {
"__typename": "BundleProduct",
"sku": "bundle-product-5",
"product_links": null
}
},
{
"__typename": "VirtualCartItem",
"qty": 2,
"product": {
"__typename": "VirtualProduct",
"sku": "virtual-product-tax-estimation"
}
}
]
}
}
}
}
Expected result:Validation should work at steps 7) 8) or 9) Actual result:Error message without <div role="alert" class="message message-error error">
<div data-ui-id="checkout-cart-validationmessages-message-error" data-bind="text: $data"></div>
</div> |
Hello. Cannot reproduce this. Got an error: 1 exception(s): |
Hello @pmclain , |
@naydav No worries. This needs a bit of updating to handle some the recent changes in the QuoteGraphQl schema anyway. |
@novikor @swnsma @XxXgeoXxX - please pick up this PR. |
@pmclain please add |
The name now reflects the purpose
@TomashKhamlai Thanks for merging in the latest upstream code. This PR is no longer functional and I'm working on getting it back in order. |
e5a573a
to
989038c
Compare
Hi @lenaorobei, thank you for the review.
|
Hi @pmclain, thank you for your contribution! |
Description (*)
Fixed Issues (if relevant)
Manual testing scenarios (*)
Contribution checklist (*)