mirror of
https://github.com/vercel/commerce.git
synced 2025-07-23 04:36:49 +00:00
fix: add on products on cart
Signed-off-by: Chloe <pinkcloudvnn@gmail.com>
This commit is contained in:
@@ -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;
|
||||
|
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user