# Product listing

<figure><img src="https://1997835572-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MlL6sK9D7unq8F2VPPp%2Fuploads%2FGeIkBQFI4LGjyGqhvlet%2Flivechat883x471%20(1).png?alt=media&#x26;token=9168d917-bd02-4cd6-a7af-eb9896c7a5ef" alt=""><figcaption><p><a href="https://apps.shopify.com/xflow?utm_source=foxecom&#x26;utm_medium=help_center_minimog&#x26;utm_campaign=banner">Install XFlow Back In Stock Automation FREE</a></p></figcaption></figure>

{% tabs %}
{% tab title="Grid" %}
![](https://1997835572-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MlL6sK9D7unq8F2VPPp%2Fuploads%2FSDZwf0VAdXKXTkahxzjU%2FScreen%20Shot%202021-11-08%20at%2020.14.00.png?alt=media\&token=42576d97-28ac-4bcf-ba8a-836a8cc6042d)
{% endtab %}

{% tab title="List" %}
![](https://1997835572-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MlL6sK9D7unq8F2VPPp%2Fuploads%2F26kP4D9PRZTExzThcefu%2FScreen%20Shot%202021-11-08%20at%2020.14.10.png?alt=media\&token=3c4a3a2e-be1b-42ac-b74b-ccf5e72efbeb)
{% endtab %}
{% endtabs %}

Showing a list of products based on a category in grid or list view.

{% hint style="success" %}
Steps

1. In the theme editor (**Customize**), open the template selector
2. Select **Collections**, then **Default collection.**
3. On the left-sidebar, add **Product listing.**
4. Make necessary changes **> Save.**
   {% endhint %}

## General and Layout

* Control the listing's container type and layout.
* Show the number of products per row and per page.

![](https://1997835572-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MlL6sK9D7unq8F2VPPp%2Fuploads%2FznnYUqAbkxL44n4Qn1mc%2FScreen%20Shot%202021-11-08%20at%2020.12.52.png?alt=media\&token=5d6fa365-5abb-4b35-9ddd-f2aeb30f7698)

* Enable or disable the columns switcher.

![](https://1997835572-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MlL6sK9D7unq8F2VPPp%2Fuploads%2FgXwtN1jyPv0rpceKEVOU%2FScreen%20Shot%202021-11-08%20at%2020.20.55.png?alt=media\&token=be8cf9af-37ec-44f9-a379-3710cc9dc2a5)

## Sorting and filtering

![](https://1997835572-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MlL6sK9D7unq8F2VPPp%2Fuploads%2FKIct8brcWzgZhYJgWa17%2FScreen%20Shot%202021-11-08%20at%2020.22.49.png?alt=media\&token=dcbcfc83-bb09-44e0-8af4-63fe949e1ef5)

Enable/ disable filtering and sorting by options.

You can choose to display filters by **storefront filters** or by **custom tags**.

<figure><img src="https://1997835572-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MlL6sK9D7unq8F2VPPp%2Fuploads%2FdpTmtaE39eeEMm4l6hk3%2Fimage.png?alt=media&#x26;token=c9aaf77b-545f-4347-a8d9-a15192764876" alt=""><figcaption></figcaption></figure>

### How to create a filter

{% tabs %}
{% tab title="Filters by custom tags" %}
{% embed url="<https://www.youtube.com/watch?t=55s&v=bPmgW9uGTxA>" %}

{% hint style="success" %}
**Steps**

1. In the theme editor (**Customize**), open the template selector
2. Select **Collections**, then **Default collection.**
3. On the left-sidebar, add **Product listing.**
4. Add block **"Filter by tags"**
5. Change the filter title and its tags list (separated by a comma). Choose a suitable design for the filter display.
6. Merchants can decide to display the filter option expand or collapse by default.
   {% endhint %}

![](https://1997835572-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MlL6sK9D7unq8F2VPPp%2Fuploads%2FjcYDgNoBHKI0j2XmYkgi%2FScreen%20Shot%202021-11-16%20at%2020.43.04.png?alt=media\&token=288ac98c-0e05-4282-8ed2-a8d88cf9d03c)

7\. **Save.**

{% hint style="info" %}
To make your tags work well, check out [this Shopify guideline for tags](https://help.shopify.com/en/manual/products/details/tags).
{% endhint %}
{% endtab %}

{% tab title="Filter by storefront filters" %}
{% embed url="<https://youtu.be/lraIZ3yRc78>" %}

**Steps**

1. In your **Shopify Admin** > **Navigation**&#x20;
2. Click **Add** and install [**Shopify Search & Discovery**](https://apps.shopify.com/search-and-discovery) app for your store

<figure><img src="https://1997835572-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MlL6sK9D7unq8F2VPPp%2Fuploads%2FFisatL9BdfGYyZC0bjSz%2Fimage.png?alt=media&#x26;token=4b19a5ce-c9f6-40b6-b32d-fdd06aaee2a5" alt=""><figcaption></figcaption></figure>

3\. Go to **Apps** > **Search & Discovery** > **Filters** > **Edit filters**

4\. Add or remove filters to show/hide from the storefront filters > **Save** the settings.

5\. In the theme editor (**Customize**), open the template selector >Select **Collections** > **Default collection.**

6\. On the left-sidebar, locate **Product listing** > **Filter type** > Select **Storefront filters**

7\. **Save**
{% endtab %}
{% endtabs %}

You can change the filter position, title, and height.

### How to create a visual filter

Filter values can include visual elements such as colors, patterns, or other creative imagery.&#x20;

For example, a *Fabric color* filter can display a small color swatch for each filter value.

To create visuals with your filter values, set up custom data for your store with [metafields](https://help.shopify.com/en/manual/custom-data/metafields/metafield-definitions/creating-custom-metafield-definitions) and [metaobjects](https://help.shopify.com/en/manual/custom-data/metaobjects/using-metaobjects). You also need to meet the [requirements](https://help.shopify.com/en/manual/online-store/search-and-discovery/filters#visual-filters).

{% hint style="info" %}
Product variant filters will link to more relevant variants on search results and collection pages.
{% endhint %}

#### Now we will start from scratch by defining the [metaobjects](https://help.shopify.com/en/manual/custom-data/metaobjects/using-metaobjects):

1. Go to **Settings** > **Custom data** > Find the **Metaobject definitions** field > Click **Add definition.**

<figure><img src="https://1997835572-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MlL6sK9D7unq8F2VPPp%2Fuploads%2FSEB3kW7Ktz0RUv9BthIW%2F2.webp?alt=media&#x26;token=ae2c68e0-41a1-4cde-8be3-9984d33afcc4" alt=""><figcaption></figcaption></figure>

2. In the **Add metaobject definition** page, give this metaobject a **Name** (Color) and define 3 **Fields:**

* **Single line text** - For the color name (Name).
* **Color** - For the hex code of the actual color (Hexcode).
* **File** - For the image of this color (Image).

<figure><img src="https://1997835572-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MlL6sK9D7unq8F2VPPp%2Fuploads%2FHQbfg1HjlS7qnN6KIvy8%2F1.webp?alt=media&#x26;token=c8aae627-68cb-47b9-a96f-aa00830db7b1" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
A metaobject definition for a color swatch should have both **a color** and **an image field**.&#x20;

You don't need to provide a value for both, but this will give you the option of using either field in the future.
{% endhint %}

3. Click **Save**.

#### Next, we will create the colors list:

1. In the Shopify admin sidebar, go to the **Content** > **Metaobjects** > In the **Metaobjects** page, select **Color**.

<figure><img src="https://1997835572-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MlL6sK9D7unq8F2VPPp%2Fuploads%2FZnwgFFKBIts7iU4j0Vdp%2F3.webp?alt=media&#x26;token=e2ff7030-bbe6-4215-9191-7a5b4c095584" alt=""><figcaption></figcaption></figure>

2. Click the **Add entry** button to add a new color. Give the color entry the Name, Color, and Image.

<figure><img src="https://1997835572-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MlL6sK9D7unq8F2VPPp%2Fuploads%2FA7uNVxeCqHrrKwO4MHR7%2F4.webp?alt=media&#x26;token=cd237c31-ad27-4bf5-ac80-391645eb6925" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
**Note**: You can add many color entries and assign these colors to the products.
{% endhint %}

<figure><img src="https://1997835572-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MlL6sK9D7unq8F2VPPp%2Fuploads%2FrbeuQRHU5beyfzJegLuX%2F5.webp?alt=media&#x26;token=9670535e-097f-4e32-b552-11e139abc256" alt=""><figcaption></figcaption></figure>

3. Click **Save**.&#x20;

#### After that, we are going to create color [metafields](https://help.shopify.com/en/manual/custom-data/metafields/metafield-definitions/creating-custom-metafield-definitions) for the products to link to these [metaobjects](https://help.shopify.com/en/manual/custom-data/metaobjects/using-metaobjects) that we've just created above:

1. Go to **Settings** > **Custom data** > In the **Metafield definitions** field, select **Products** > Click **Add definition.**

<figure><img src="https://1997835572-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MlL6sK9D7unq8F2VPPp%2Fuploads%2Fbg7PfFG8o0bfPjrsA6mE%2F6.webp?alt=media&#x26;token=407456f7-3abb-44b8-8538-281848f62255" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1997835572-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MlL6sK9D7unq8F2VPPp%2Fuploads%2F2XuUq2YmTSTH1GAaMS9D%2F7.webp?alt=media&#x26;token=a13ef5ae-7fe6-4055-b8e8-f831acd1b284" alt=""><figcaption></figcaption></figure>

2. We will define this metafield as **Name**: "Color filter swatch" and **Type**: "Metaobject". In the **Reference** field, select the metaobject you want or you've just created (Color).

{% hint style="info" %}
If your products/ variants have multiple colors you could filter on, set your metafield definition to allow a **List of entries**.&#x20;

This lets you assign multiple metaobject entries to a single item and each one will display as a filter value on your store.
{% endhint %}

<figure><img src="https://1997835572-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MlL6sK9D7unq8F2VPPp%2Fuploads%2FBFwplcHLW9XAtgQTQhHK%2F8.webp?alt=media&#x26;token=59904e9a-8631-4d8a-8d59-f0d8da879720" alt=""><figcaption></figcaption></figure>

3. Click **Save.**

#### Then, we will connect the products to colors:

1. In the Shopify admin sidebar, go to the **Products** > Select the product you want to connect color metafield.
2. In the **Metafields** field, click on the "Color filter swatch" metafield that you've just created above > You will be able to select multiple colors from your list of colors that you defined using metaobjects.

<figure><img src="https://1997835572-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MlL6sK9D7unq8F2VPPp%2Fuploads%2FxZAmwDktMw2noHwOZpMo%2F9.webp?alt=media&#x26;token=73ca8996-600a-4d6e-8fc5-e9b631f574db" alt=""><figcaption></figcaption></figure>

3. Click **Save**.

#### After you have assigned your metafield to products or variants in your store, you can set up the filter for your online store:

1. In the  [Shopify Search & Discovery](https://apps.shopify.com/search-and-discovery) app, go to **Filters**.
2. Click **Add filter** or click an existing filter.
3. Click the **Source** field, and then select a metafield filter with a metaobject reference - "Color filter swatch".
4. Click **Display options**.
5. Set the **Label** field for filter values by selecting a metafield.
6. Check **Include visual** and select a visual style:
   * Choose **Swatch** for small color swatches or patterns. Set the swatch content by selecting:
     * A color field for the **Swatch color**.
     * An image field for the **Swatch pattern.**

<figure><img src="https://1997835572-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MlL6sK9D7unq8F2VPPp%2Fuploads%2FAyZGF1vLfOyneEFMITjq%2F10.webp?alt=media&#x26;token=597c9e10-71e5-4db0-93fd-ef30a664a6d5" alt=""><figcaption></figcaption></figure>

* Choose **Image** for icons, logos, or other graphics that shouldn't be cropped. Set the content by selecting an image field for the **Image**.

<figure><img src="https://1997835572-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MlL6sK9D7unq8F2VPPp%2Fuploads%2FqPkE0rKAkvFAJ4Fzxz8w%2F11.webp?alt=media&#x26;token=5bbc0dff-9a1f-472f-923d-353a06f64bb2" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
**Tip** :sparkles:

Themes will often prioritize displaying a swatch's image over its color.&#x20;

For swatch displays, if you select fields for both **Swatch pattern** and **Swatch color**, then the color is typically only displayed when there isn't an available pattern image for the filter value.
{% endhint %}

7. Click **Save**.

{% tabs %}
{% tab title="Image" %}

<figure><img src="https://1997835572-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MlL6sK9D7unq8F2VPPp%2Fuploads%2FeRhCnyyCIm8FwZQ0oaYt%2F12.webp?alt=media&#x26;token=1328a95e-6c65-42ff-b4c2-519ac6a21029" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Swatch color" %}

<figure><img src="https://1997835572-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MlL6sK9D7unq8F2VPPp%2Fuploads%2Fys7coVUH8cAwBjVeIMYt%2F12a.png?alt=media&#x26;token=c89becf8-7096-485c-a475-e2dfcab9e2c8" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}

#### How to customize filters

{% hint style="info" %}
Customizing store filters requires the [Shopify Search & Discovery](https://apps.shopify.com/search-and-discovery) app.&#x20;

The app also allows you to customize search results and product recommendations to give you more control over how customers discover your products.&#x20;

Learn how to [customize filters with the app](https://help.shopify.com/en/manual/online-store/search-and-discovery/filters).
{% endhint %}

1. Go to **Online store > Navigation**&#x20;
2. Click **Add** and install the [**Shopify Search & Discovery**](https://apps.shopify.com/search-and-discovery) app for your store&#x20;

<figure><img src="https://1997835572-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MlL6sK9D7unq8F2VPPp%2Fuploads%2FSVSBNWkPexK7FRf2iEmx%2F14.webp?alt=media&#x26;token=72536746-ec22-4c29-aabe-f75b80ca0f54" alt=""><figcaption></figcaption></figure>

3. Go to **Apps** > **Search & Discovery** > **Filters** > **Edit filters**

<figure><img src="https://1997835572-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MlL6sK9D7unq8F2VPPp%2Fuploads%2F2gP1eAUbftnfc9v7Htg9%2F15.webp?alt=media&#x26;token=c5b2d2b2-04fd-4cd5-86d2-5795ac48459a" alt=""><figcaption></figcaption></figure>

4. Add or remove filters to show/hide from the storefront filters > **Save** the settings.
5. In the theme editor (**Customize**), open the template selector > Select **Collections** > **Default collection.**
6. On the left-sidebar, locate **Product gird** > Select **Enable filtering** checkbox
7. **Save**

### Pagination

![](https://1997835572-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MlL6sK9D7unq8F2VPPp%2Fuploads%2FPOurhIE57DOV8krKRqbc%2FScreen%20Shot%202021-11-08%20at%2020.22.40.png?alt=media\&token=2819c461-11c2-4f09-ace5-28015a173f9d)

Enable pagination in 3 ways.

{% tabs %}
{% tab title="Pagination by numbers" %}
![](https://1997835572-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MlL6sK9D7unq8F2VPPp%2Fuploads%2FlCWSasLZEooQPMGhon0F%2FScreen%20Shot%202021-11-08%20at%2020.30.09.png?alt=media\&token=fb12dff0-8b4f-419a-98ec-f04f69b4dc55)
{% endtab %}

{% tab title="Load more button" %}
![](https://1997835572-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MlL6sK9D7unq8F2VPPp%2Fuploads%2FswjsJMFwRAO6bv9RUZz5%2FScreen%20Shot%202021-11-08%20at%2020.31.50.png?alt=media\&token=8b71027f-9d8a-4164-a4c3-bb16fbe45e93)
{% endtab %}

{% tab title="Infinite scroll" %}
![](https://1997835572-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MlL6sK9D7unq8F2VPPp%2Fuploads%2Fgmot21GwFN4OkCbEdI0a%2FlUUI5pi7Tt.gif?alt=media\&token=517c07cf-a81d-4992-8738-a17e868e749b)
{% endtab %}
{% endtabs %}

### Filter settings

This setting is for storefront filters only.&#x20;

You can enable changing product card variants on filtering and showing results count on filter items.

<figure><img src="https://1997835572-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MlL6sK9D7unq8F2VPPp%2Fuploads%2FOvkSIa7apRJbB47WEb4C%2Fimage.png?alt=media&#x26;token=a0b30ac9-5974-4a0b-9909-2409e2c62c68" alt=""><figcaption></figcaption></figure>
