What's your biggest current challenge? Have your say in Community Polls along the right column.

Filter products (tag) using other languages

Filter products (tag) using other languages

jamalsoueidan
Shopify Partner
66 3 9

I find it weird you cannot filter products on tag when using other languages, since tags is not supposed to be translated?? 

 

{
  "handle": "james-105",
  "filters": [
    {
      "tag": "locationid-6662ec5651a73e0c236762c5"
    },
    {
      "tag": "scheduleid-6655dca6af3a95287b6b701a"
    },
    {
      "productMetafield": {
        "namespace": "system",
        "key": "type",
        "value": "product"
      }
    },
    {
      "productMetafield": {
        "namespace": "booking",
        "key": "hide_from_combine",
        "value": "False"
      }
    }
  ],
  "country": "DK",
  "language": "EN"
}

This is an example I want to filter on metafield and tags, but this is not possible when switching language.

So I'm left with using query (metafield search not available) or use filter (and only metafield is available).

 

I wonder why on earth did the developer choose to do it this way. 

TAGS is not supposed to be translated in my situation!!

 

MY problem is I want to filter on PRICE and on TAG and that combination is not possible when using other language then the default! I cannot add the tags to metafields, since they are dynamic, such as locationid--12, locationid-14 etc.

 

What solution is there to this problem?

 

Replies 2 (2)

jamalsoueidan
Shopify Partner
66 3 9

It seems you can combine price and tag with query! 

rondo10
Shopify Partner
2 0 0

tackling the same problem.

this query work properly:

query @inContext(language: EN) {
  collection(handle: "collectionA") {
    products(filters: {tag: "blue"}, first: 10) {
      edges {
        node {
          title
          tags
        }
      }
    }
  }
}

 but only changing the language code and there are no prouducts in the response:

query @inContext(language: DE) {
  collection(handle: "collectionA") {
    products(filters: {tag: "blue"}, first: 10) {
      edges {
        node {
          title
          tags
        }
      }
    }
  }
}