Access the customer tags inside shopify function but this function is for multiple retailers

Access the customer tags inside shopify function but this function is for multiple retailers

Sebashish
Shopify Partner
7 0 3

I am building one app which can be used by multiple retailers. And in that app there is one function called cart transform.  Inside that function I want to access the customer tags or know whether a customer has particular tags. I know how to parameterise the input of the graphql query. But when you create/register this function this parameter is not as per the retailers. This is a complete list of tags that is published to my app and that is running for all the customers. But I want to parameterise this query based on the vendor. For different vendors the customer tags would be different. How to achieve that?

query RunInput($customerTag: [String!]) {
  cart {
    buyerIdentity {
      customer {
        amountSpent {
          amount
        }
        hasTags(tags: $customerTag) {
          hasTag
          tag
        }
      }
    }
  }
}

 

Reply 1 (1)

YOD_Solutions
Shopify Partner
274 28 42

I think you need to use app metafields to store the customer tags for each vendor. Your input uses the customer tag saved in the metafield. See here for more info: Metafields for input queries

Founder @ JsRates: Custom Shipping Rates
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more about JsRates visit the JsRates home page or JsRates documentation
- Find JsRates on Shopify app store