Accessing Search & Discovery Filter

Topic summary

A developer seeks to access and display Search & Discovery filter data on product pages to enable dynamic linking to related products.

Specific Goal:

  • Display filter values (e.g., “Material: Cotton”) on product pages
  • Create clickable links that direct customers to collection/search pages showing all products with the same filter value

Proposed Solution:
A respondent suggests two approaches:

  • Use metafields to store and retrieve filter values
  • Use product tags as an alternative method
  • Provided liquid code examples for both implementations

Outstanding Question:
The original poster asks whether it’s possible to retrieve the grouped category filter value from Search & Discovery, specifically when multiple variations (e.g., “cotton” and “Cotton”) are consolidated into a single filter option. This would ensure links capture all products in the unified category rather than treating variations as separate filters.

Status: The technical implementation path is outlined, but the question about accessing grouped filter categories remains unresolved.

Summarized with AI on November 6. AI used: claude-sonnet-4-5-20250929.

We want to be able to access and display Search & Discovery filters on product pages.

For instance, let’s say I have a cotton tee shirt that is part of the Material → Cotton filter label. We want to be able to put a link on the page that links to all other products with the same material value (Cotton).

Can Search & Discover filter data be accessed on product pages to enable linking in this way?

Hi,

Access product’s filter value using metafields or tags
Display Filter Data on the Product Page by using liquid code

Code example for metafields

{% if product.metafields.custom.material %}
  

Material: {{ product.metafields.custom.material.value }}

{% endif %}

Code tag example

{% assign material = product.tags | where: 'Material' %}

Material: {{ material }}

Create a link that applies the same filter to a collection or search page, enabling customers to view related products.

Thank you.

In Search & Discovery you’re able to group metafields into categories. I.e. if you had mixed capitalization in your metafields for some reason you could put “cotton” and “Cotton” into one filter so they don’t show up as two options.

Is it possible to get the value of the category filter so I can build links that would include all products in the category filter?