hasAnyTag but not listing of product tags? #241
Replies: 3 comments 9 replies
-
Hello Jesper 👋🏻 That would be nice and simple, but for many products that list is too large for us to send. Is there something specific you're trying to accomplish with a complete list of tags that isn't well served by the current API? |
Beta Was this translation helpful? Give feedback.
-
For those of us migrating from Scripts that require checking a list of product tags without eating up our query cost allowance, there's another potential solution that was introduced in a recent API version. Instead of using
Shopify will perform the comparison for you and return a data structure containing each tag you provided and whether or not that tag is assigned to the product. E.g:
It is a bit cumbersome, but there are many benefits to this approach: you don't have to hard-code specific tags in your input query, its query cost is just '3' for checking multiple tags, and you don't have to migrate tags to metafields. |
Beta Was this translation helpful? Give feedback.
-
As mentioned above, the |
Beta Was this translation helpful? Give feedback.
-
Firstly thanks for making Shopify Functions, and adding support for JS 💚!
After working with Functions for the past week, I found it a limitation that you can check if a product has a specific hasAnyTag().
This is a nice filter/function. But I'm really missing the possibility to read all the tags of a given product in the cart.
So instead of having a true/false if a product has a tag, it would be cool to have all the tags of the product instead to be honest.
Beta Was this translation helpful? Give feedback.
All reactions