Discussing Shopify Functions development, deployment, and usage in Shopify apps.
Hi,
I am looking to hide the Cash on Delivery payment method for customers tagged with "tag1", and hide another payment method for customers tagged with "tag2". However, I'm having trouble implementing this.
I have tried using the code below, but it seems to always return true for both hasAnyTag fields:
query Input {
cart {
buyerIdentity {
customer{
hasAnyTag(tags: ["tag1"])
hasAnyTag2 : hasAnyTag(tags: ["tag2"])
}
}
}
}
Could you please advise on the correct code to achieve this? Thank you for your assistance.
Solved! Go to the solution
This is an accepted solution.
Hi @agastify -- This issue should now be resolved!
Nick Wesselman | 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 the Shopify Help Center or the Shopify Blog
This is an accepted solution.
Hi @agastify -- This issue should now be resolved!
Nick Wesselman | 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 the Shopify Help Center or the Shopify Blog
Hey Nick,
I have a similar question. I have a feeling the answer was in this thread, but it looks like the solution has gone missing! Would you be able to repost?
Thanks!
Edit: For context, I am also attempting to check for multiple tags using `hasAnyTags` with little success.
I have tried the following:
Hi @Acariah
This is the correct format
hasAnyTag(tags: ["tag1", "tag2"])
it will match any of tag1 or tag2