# Search and filters

Chapter 13 of the Loot user guide.

## Collection and search pages

The **Collection** section shows the collection's banner (**Show collection image**, **Show description**), the rarity strip, a toolbar and a grid of blister cards. The toolbar has one chip per filter (each opens a small panel), an **In stock only** switch (from the Availability filter), the result count and **Sort**. On phones the filters, switch and sort move into a bottom drawer behind one **Filter and sort** key, applied when it closes. Filtering updates the results without reloading the page, and works without JavaScript too.

Its settings: **Show breadcrumbs**, **Show collection image**, **Show description**, **Enable filtering** and **Enable sorting** (all on), **Show vendor** (off), **Columns on desktop** (4; 3, 4 or 5), **Columns on mobile** (2; 1 or 2) and **Products per page** (12, 8 to 36).

The **Search** section has **Show breadcrumbs**, **Enable filtering**, **Enable sorting** and **Results per page** (12, 8 to 36). As shoppers type in the header's search field, a panel suggests searches and shows matching products (with prices), collections, pages and articles.

## Set up filters with Search & Discovery

Filters come from Shopify's free **Search & Discovery** app. Install it from the Shopify App Store, open it, go to **Filters › Add filter**, choose the source and give the filter its name (label). Loot draws three kinds of filter in its own way, matched by name:

| Filter | Source in Search & Discovery | Name it | How Loot shows it |
| --- | --- | --- | --- |
| Rarity | Product metafield **Rarity** (`custom.rarity`) | The **Rarity filter name** in Theme settings › Collecting ("Rarity") | The **rarity strip** above the toolbar: one chip per value, each with a gem in its rarity color (a sparkle for chase) and its product count |
| Players | Product metafield **Max players** (`custom.players_max`), or a list metafield of your own (below) | The **Players filter name** ("Players") | Number chips |
| Condition | Variant option **Condition** (or Grade) | The option's name, as listed in **Condition option names** | Chips with condition pips |

Every other filter (price, product type, vendor, tags, Series, Exclusive, Grade and any metafield) shows as a checklist, or From and To fields for price.

* **Rarity values** show as you stored them, so store "Legendary" rather than "legendary" if you want capitals in the strip (the theme reads either, chapter 7).
* **Players, the quick way**: filter on Max players. "4" then finds games whose top player count is 4. **The precise way**: create one more product metafield just for filtering, such as **Player counts** (`custom.player_counts`, List of single line text) holding every count a game plays (2, 3, 4), filter on that, and name the filter "Players". The theme doesn't read that metafield anywhere else.
* A filter you add appears on every collection and on search results; values with no products in the current collection are disabled.

## The rarity strip from tags

No rarity filter, but your products are tagged `rarity:common` to `rarity:chase`? Turn on **Build the rarity strip from tags** (Theme settings › Collecting). Collection pages then show an **All** chip and one chip per rarity tag found in the collection, labelled with your rarity labels, each linking to the collection narrowed by that tag. A Rarity filter wins when both exist. With neither, the strip doesn't show.
