Links

Filtering with metafields

Create custom filter options easily with metafields
Pipeline offers the ability to create powerful filtering options to help shoppers find products and product features within collections. Easily build custom filter options using metafields and combine with other filter tools like color, size, availability, price and more.
Custom filter options are dynamically displayed by Pipeline, keeping the filter area clean and only displaying valid filter options:
For example, each of these Designer options match products listed on the current collection page:
Filter groups can be combined with other filter tools to robust filtering

How to setup

There are a few very basic steps needed to create and use custom filter options. Here is a quick breakdown:
Basic steps
  1. 1.
    Using the Shopify Admin under Settings, define a product metafield for each filter group. The Content type is Single line text (List).
  2. 2.
    In the Product Setup, add values to each product to match any custom filters you've created.
  3. 3.
    Shopify Admin under Navigation, enable your custom filters.
  4. 4.
    Using the Theme Editor, add the Filters block to Collection product grid.
Each step is covered in detail below.

Defining metafields

Each filter group is created by defining a product metafield. In the example above for "Designer", that is one filter group and can have multiple values. Plan out and create as many Filter Groups as needed. Each one is done by defining a product metafield with the Content type set to Single line text (List).
Start in the Shopify Admin under Settings (bottom left of your Admin screen) and then choose Metafields in the left column:
Shopify Admin -> Settings -> Metafields
Steps for creating metafields
  1. 1.
    Click on Metafields on the left column, choose Products and then click the Add definition.
  2. 2.
    Under Name, choose a name that describes your custom Filter Group.
  3. 3.
    The description is optional but can be a helpful note for managing content.
  4. 4.
    Click on the Select content type button and choose Single line text.
  5. 5.
    Next, choose List of values.
Define a new product metafield for each collection filter group.

Add values to each product

The the Shopify Admin -> Products, add values to your newly created metafields:
Multiple items can be added
If your product has multiple values, you can keep adding them to the item list. An example would be multiple values for that filter group. If our product had multiple designers, we can add them to the list.
Each product will need a value in order for that product to appear in a custom filter list.

Enabling filter groups

After each custom filter group has been defined/created, you can turn them on/off easily in the Navigation section of the Shopify Admin:
Shopify Admin -> Navigation -> Collection and search filters
Choose Add filters:
Shopify Admin -> Navigation -> Collection and search filters
Sorting You can use the "handle" icon on the left (six dots) to sort the order how you want your filter options to appear on collection pages. This is the only place to mange the sort order.
Under Add filters -> Metafields, toggle on or off your custom filter groups:
Use the Done button when completed.

Add filters block

The final step is to add the Filters block in the Collection product grid section. Using the Theme Editor (Customize theme), navigate to a collection page or collection template and verify the Filters block has been added.
This enables all filter tools including: Availability, Price, Product type, Vendor, Amount, Color, Size etc. You may already have added this block earlier in your theme setup.
Theme Editor -> Default Collection template -> Collection product grid
When the Filters block is added and active, all filter tools become available to shoppers that are configured in the Navigation -> Filters section.