Discussing Shopify Functions development, deployment, and usage in Shopify apps.
query Input { cart { buyerIdentity { customer { hasAnyTag(tags: ["vip"]) } } } discountNode { metafield(namespace: "$app:order-discount", key: "function-configuration") { value } } }
Here hasAnyTag has a hardcoded tag vip.
I want to use dynamic tags here so that customers can set their own tags.
Can I use the Metafield value here?
Solved! Go to the solution
This is an accepted solution.
Hi Ifat802,
Have you looked into using variables in input queries - it sounds like this is what you'll need for using metafields in this context.
Hope this helps!
Liam | Developer Advocate @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
This is an accepted solution.
Hi Ifat802,
Have you looked into using variables in input queries - it sounds like this is what you'll need for using metafields in this context.
Hope this helps!
Liam | Developer Advocate @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
Great to hear!
Liam | Developer Advocate @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog