Discussing Shopify Functions development, deployment, and usage in Shopify apps.
I'm trying to implement customized bundles using the Cart Transform Function API. From this page, it mentions that if the parent variant can't be purchased without components, then you must mark the parent bundles with the requiresComponents attribute to true.
But I can't find the requiresComponents field on the parent variants. I try to view this variant json by the link: https://admin.shopify.com/store/my-store/products/8599060644139/variants/46643412402475.json
But the field doesn't appear. Also, I try to view the variant object with Python API and it's the same. The field doesn't exist on the variants.
Is this requiresComponents field effective now?
Hi Jam_chan,
I came across this question while developing my own cart bundling function, as I was also confused when viewing that page from the docs.
You should be able to set the required attribute using the below mutation via the Shopify GraphiQL App(or any other GraphQL interface):
mutation {
productVariantUpdate(input: {id: "gid://shopify/ProductVariant/IDGOESHERE", requiresComponents: true}) {
productVariant {
id
requiresComponents
}
userErrors {
field
message
}
}
}