fix: add on products on cart

Signed-off-by: Chloe <pinkcloudvnn@gmail.com>
This commit is contained in:
Chloe
2024-06-19 17:13:29 +07:00
parent 87685fda61
commit cc3982288a
10 changed files with 128 additions and 36 deletions

View File

@@ -1,9 +1,13 @@
import productFragment from './product';
import imageFragment from './image';
const cartFragment = /* GraphQL */ `
fragment cart on Cart {
id
checkoutUrl
attributes {
key
value
}
cost {
subtotalAmount {
amount
@@ -38,11 +42,22 @@ const cartFragment = /* GraphQL */ `
value
}
product {
...product
featuredImage {
...image
}
handle
title
productType
}
coreVariantId: metafield(key: "coreVariant", namespace: "custom") {
value
}
addOnQuantity: metafield(namespace: "custom", key: "add_on_quantity") {
value
}
addOnProductId: metafield(namespace: "custom", key: "add_on") {
value
}
}
}
}
@@ -50,7 +65,7 @@ const cartFragment = /* GraphQL */ `
}
totalQuantity
}
${productFragment}
${imageFragment}
`;
export default cartFragment;

View File

@@ -64,6 +64,12 @@ const productFragment = /* GraphQL */ `
condition: metafield(namespace: "custom", key: "condition") {
value
}
addOnQuantity: metafield(namespace: "custom", key: "add_on_quantity") {
value
}
addOnProductId: metafield(namespace: "custom", key: "add_on") {
value
}
}
}
}