Request for Comment: Faceted Filtering #10
Replies: 25 comments 44 replies
-
Looking forward to this update! The one key feature that's missing is the ability to filter based on product This Storefront API approach will unfortunately not meet that common use case without support for tags. |
Beta Was this translation helpful? Give feedback.
-
Being able to filter when directly querying a collection is a huge step forward. We had to jump through quite a few hoops to get our filters working on our Storefront API implementation.
It would be really useful to have product tags available on the ProductFilter input. |
Beta Was this translation helpful? Give feedback.
-
I'll have to give +1 to the idea that product tags are a fundamental use case for the vast majority of merchants to flexibly be able to create facets and dimensions. Especially in Not having the ability to query a collection by tag facets makes using the Storefront API a non-starter for most merchants we work with. It forces us onto third-party search solutions every time. |
Beta Was this translation helpful? Give feedback.
-
Apart from adding the tags to the filters, it will be nice to get the number of products count when filters are applied. |
Beta Was this translation helpful? Give feedback.
-
As others have already mentioned here having the ability to filter by tag and/or metafields is pretty important. These are some real world examples, from some of my clients, of things that need to be filtered on collections—outside of price, variant option, type, or vendor:
|
Beta Was this translation helpful? Give feedback.
-
Something is wrong here, i have installed Shopify GraphiQL App on my site. Document https://shopify.dev/custom-storefronts/products/filter-products#query-products-by-vendor |
Beta Was this translation helpful? Give feedback.
-
This is also the number one customization request I get from merchants. I'm finding that I cannot use any of the new 2.0 filters at all because they don't integrate with tag filtering, and the flexibility of tag filtering wins out. The new filter url params do not appear to work on urls that have tag filtering applied (see screenshot below, which is the latest Dawn out of the box). There are only two products with the tag "banana" and the filters still show number results based on the full collection, and the price filter that is applied isn't filtering out the $1.00 product like I would expect it to. This also means any link in a navigation to a collection that is filtered by tag can't use the new collection filters. This has made the new filters unusable now for my merchants. Some workarounds I've done are to generate tags based on the vendor name to be able to filter by brand, and are now looking to utilize tags to be able to add our own "availability" and "product type" filters in the same way. Two examples of custom category filters for stores that I am working on that are using tag filters: Sustainable Grocery Store
Streaming Travel Seminars
Besides this limitation, I've been really excited about all the other 2.0 upgrades. Keep up the good work! |
Beta Was this translation helpful? Give feedback.
-
To add yet more real world use cases of merchants depending on tag filtering: An apparel company filtering a "Dress" collection of all Product Type == Dress with Style_Maxi, Style_T-Shirt, Style_Long Sleeve, etc. A wellness company filtering by Concern. Concern_Tiredness, Concern_Soreness, Concern_Nausea, etc. A maternity brand filtering bras by Feature. Feature_Pumping, Feature_Active, Feature_Cooling, etc. A maternity brand filtering bras by Style. Style_Bralette, Style_Plunge, Style_T-Shirt, etc. A medical orthotics company wanting to filter products based on Insurance coverage. Insured_Anthem, Insured_Blue Cross, etc. A meal delivery service with diet and ingredient filtering. Lifestyle_Gluten Free, Lifestyle_Vegan, Meat_Chicken, Meat_Beef, etc. In my experience, products frequently have multiple tags assigned to them, and diff collections may use diff tag filters. The filtering happens at the product level, not the variant level. Product metafields could prbly work; but almost all the apps and themes with filtering solutions use tags, since they've been so much more accessible via the UI Admin historically. Using a schema like "Prefix_Display Name" keeps tags that aren't meant to be front-facing out of the UI. A pretty nice solution is the one the app Boost uses, where you can build different filter trees and then assign trees to different collections. |
Beta Was this translation helpful? Give feedback.
-
Hi, |
Beta Was this translation helpful? Give feedback.
-
any update on this? Can't use this for my client at the moment :( |
Beta Was this translation helpful? Give feedback.
-
Thanks for all the feedback so far! A quick update here - we are looking into the option of leveraging metafields as part of filtering to provide an additional parameter for filtering. I understand that tags are currently in use for many reasons, but the unstructured nature of tags make them difficult to leverage. Metafields with various types will provide additional flexibility and transparency for approaching how filtering works. It sounds like overall there are no major concerns about the approach of the schema itself though so I'm working with the team to see when we can get this work completed. I'm hoping this can be added to the upcoming storefront API version. |
Beta Was this translation helpful? Give feedback.
-
Thank you for working on this! Another case of needing to be able to filter by tags (or maybe metafields) is my gift/party supply store where I need to filter by party theme, age range, holiday/occasion, etc. I've been holding off on updating to 2.0 since finding out that tag filters don't seem to be included in the new system. I never had any trouble with the old tag system which worked perfectly - if I needed to use tags for admin purposes that I didn't want to show up on the storefront I would just use "unless tag contains..." to prevent it from being displayed. I hope that tag filtering can be restored as otherwise 2.0 looks great but this is a big important missing piece that essentially renders it unusable to me, so I appreciate all who are working on this! |
Beta Was this translation helpful? Give feedback.
-
In addition to that point by @morganmccunn while we all love tags as a hammer for workarounds they can be a double edge sword that too easily exposes back end organizational info or private data to front ends ,sensitive or not , because it's often forgotten to put restraints on that tag data or having any maintenance process that validates them when staff enters them in an admin. And for themes the underscore convention to suppress tags is not universal in themes, or able to be enforced in the admin. And tags cannot be omitted from the ajax apis. |
Beta Was this translation helpful? Give feedback.
-
New filtering in liquid storefronts is limited to collections with up to 1000 products. Will Storefront API filtering work with collections larger than 1000 products? |
Beta Was this translation helpful? Give feedback.
-
For us, the biggest limitation is the limit of 1000 products in the collection. We would like to be able to use native Shopify filters and with this limit we are not able to. |
Beta Was this translation helpful? Give feedback.
-
Hey @morganmccunn, great to see that the metafields MVP has been released (https://shopify.dev/themes/navigation-search/filtering#product-specific-filters)! Quick question re: product-specific metafield filters. The docs include Is this a typo, and can you confirm that both product-level and variant-level metafields can be used in filters? (🤞) |
Beta Was this translation helpful? Give feedback.
-
Nice to see new metafield filtering, but still there is a room to improve. For example string value in this form "value1,value2" will be displayed in storefront filters as 1 option, not 2 with for me looks like a bad decision. Lack of proper "custom" filtering for things like age, groups etc. is deal breaker. 1k items per collection limit is also something that shouldn't happen. |
Beta Was this translation helpful? Give feedback.
-
Filtering by metafield is a great addition. I wanted to suggest an addition. |
Beta Was this translation helpful? Give feedback.
-
Filtering with productType and productVendor literally doesn't work both in my own project, and on Shopify's own GraphQL playground when adding the query variables exactly as shown in the tutorial and at the top of this page. Why is this broken? |
Beta Was this translation helpful? Give feedback.
-
Is there anything specific one needs to do to enable filters? At the moment when I ask for filters for a specific collection I only get these: {
filters: [
{
label: 'Availability',
values: [
{ count: 4, label: 'In stock' },
{ count: 0, label: 'Out of stock' }
]
},
{ label: 'Price', values: [ { count: 0, label: 'Price' } ] }
],
} I want to be able to filter by vendor name and by attributes :) |
Beta Was this translation helpful? Give feedback.
-
Will support for filtering all products be added at some point? Sometimes we don't want to filter by collection first :) |
Beta Was this translation helpful? Give feedback.
-
Hi everyone! Thanks again for all your wonderful feedback. Just wanted to announce a few updates:
|
Beta Was this translation helpful? Give feedback.
-
PERFORMANCES issues @morganmccunn you can update the first post with the possibility to filter on metafields that are now working.
collectionByHandle(handle: $handle) {
handle
products(first: $numProducts) {
filters {
id
label
type
values {
id
label
count
input
}
}
}
}
```
Should work without any first limit
|
Beta Was this translation helpful? Give feedback.
-
HOW TO Filtering facets: query Facets(
$handle: String!
$country: CountryCode
$numProducts: Int!
$productFilters: [ProductFilter!] = []
) @inContext(country: $country) {
collectionByHandle(handle: $handle) {
handle
products(first: $numProducts, filters: $productFilters) {
edges {node {handle: -->> THIS WORKS, ONLY ADIDAS SHOES}}}
filters { -->> HERE WE'VE ALL FACETS FOR SHOES COLLECTION, NOT FILTERED WITH {"productVendor": "ADIDAS"}
id
label
type
values {
id
label
count
input
}
}
}
}
} vars {
"handle": "shoes",
"numProducts": 100,
"productFilters":[{"productVendor": "ADIDAS"}]
}``` |
Beta Was this translation helpful? Give feedback.
-
Currently in the unstable version of the Storefront API, you'll notice changes to support filtering products within a collection! Before we commit this to a version of the API, we want your feedback to ensure this is useful and extensible:
Below is the schema you would use to build your query to filter for the desired products:
Below is the schema for returning the available filters that you can use to dynamically build your filters based on how a merchant has set up their products in the admin:
Specifically, the
filterParams: JSON!
field is meant to be a machine-readable field to help with building a validProductFilter
input. Opaque JSON was used to make theFilterValue
type generic so it wasn't locked to just filtering on products. We're curious what you think about this:Let us know what you think!
Beta Was this translation helpful? Give feedback.
All reactions