# Product listing

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

<figure><img src="https://720269760-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSnkJrgCgnPuM88XGWwwm%2Fuploads%2F28zvhhFgUpFZwCE94E9G%2Fimage.png?alt=media&#x26;token=f0f1129f-b0f8-4ebc-a183-674da4e75d04" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="List" %}

<figure><img src="https://720269760-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSnkJrgCgnPuM88XGWwwm%2Fuploads%2Fg8c2hAGEgNoWsJWGgKJE%2Fimage.png?alt=media&#x26;token=8db3c2c7-ec32-491a-95ce-501692a3e236" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}

Showing a list of products based on a category in a 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 %}

## Layout

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

<figure><img src="https://720269760-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSnkJrgCgnPuM88XGWwwm%2Fuploads%2Fc6FN3d9ALdLqvBwYP5F0%2Fimage.png?alt=media&#x26;token=f68c471d-fc20-46d6-8a9a-7526cf0bd9f3" alt=""><figcaption></figcaption></figure>

* Show layout the columns switcher.

<figure><img src="https://720269760-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSnkJrgCgnPuM88XGWwwm%2Fuploads%2FVFJakz49GSrdmJ3JCBSW%2Fimage.png?alt=media&#x26;token=9aa3133e-0486-4c3b-983a-8250c3651cca" alt=""><figcaption></figcaption></figure>

## Sorting and filtering

<figure><img src="https://720269760-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSnkJrgCgnPuM88XGWwwm%2Fuploads%2FDOcVKlfN84ANerbLhNG6%2Fimage.png?alt=media&#x26;token=a319dce8-abea-4284-a534-e42bce4e58d5" alt=""><figcaption></figcaption></figure>

Enable/disable filtering and sorting by options.&#x20;

* Enable sorting

{% hint style="info" %}
See [how to change the default sort order of a collection here](https://help.shopify.com/en/manual/products/collections/collection-layout#change-the-sort-order-for-the-products-in-a-collection).
{% endhint %}

* Enable filtering: Enable Storefront filters for your store.

{% hint style="info" %}
Customize the filters in your store with the [Shopify Search & Discovery](https://apps.shopify.com/search-and-discovery) app.
{% endhint %}

{% hint style="warning" %}
Considerations for adding filters:&#x20;

* Collections that contain more than 5,000 products don't display filters.
* A filter can display a maximum of 100 filter values on your store.
* In the Shopify Search & Discovery app, a filter displays a maximum of 1,000 filter values.
* Translations aren't supported for the **Vendor** and **Tags** filter values. The product tag filter only displays to customers shopping in your store's default language. Vendor filter values are always based on your store's default language.
* The price filter doesn't display for currencies other than your shop's default currency.

[Learn more](https://help.shopify.com/en/manual/online-store/search-and-discovery/filters?q=What+are+the+limitations+of+using+filters+in+Shopify%3F).
{% endhint %}

<figure><img src="https://720269760-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSnkJrgCgnPuM88XGWwwm%2Fuploads%2F7nXLVtMwNzhL1AlhUDck%2Fimage.png?alt=media&#x26;token=28a3c378-e847-49ec-97de-7ac783a7ae53" alt=""><figcaption></figcaption></figure>

You can also change the filter's position, title, and height.

### Pagination

<figure><img src="https://720269760-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSnkJrgCgnPuM88XGWwwm%2Fuploads%2FxLsnF253MNzMz1MSxo3s%2Fimage.png?alt=media&#x26;token=c01abf70-8daf-457f-aff7-7a678b2fc845" alt=""><figcaption></figcaption></figure>

Enable pagination in 3 ways.

{% tabs %}
{% tab title="Paging by numbers" %}
![](https://content.gitbook.com/content/SnkJrgCgnPuM88XGWwwm/blobs/htmjSQrkkUKtAA4ChpYj/Screen%20Shot%202021-11-08%20at%2020.30.09.png)
{% endtab %}

{% tab title="Load more button" %}
![](https://content.gitbook.com/content/SnkJrgCgnPuM88XGWwwm/blobs/n0QsALjZ3nZtl83TTeDj/Screen%20Shot%202021-11-08%20at%2020.31.50.png)
{% endtab %}

{% tab title="Infinite scroll" %}
![](https://content.gitbook.com/content/SnkJrgCgnPuM88XGWwwm/blobs/wTR864VkMD0Ew8AXtFV5/lUUI5pi7Tt.gif)
{% endtab %}
{% endtabs %}

### Storefront filters settings

This setting is for storefront filters only. You can enable changing product card variants on filtering and showing results count on filter items.

<figure><img src="https://720269760-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSnkJrgCgnPuM88XGWwwm%2Fuploads%2FIDKXsvy2leu4qNDXEHNj%2Fimage.png?alt=media&#x26;token=abfb3246-d2fc-4737-a77a-bff2f3e77315" alt=""><figcaption></figcaption></figure>

### **How to create a visual filter**

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

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://docs.foxecom.com/~gitbook/image?url=https%3A%2F%2F1836495117-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FOdebKCa6IK9qfbdvSKj0%252Fuploads%252FXl1bKmZf3sTUWmlA49N3%252Fimage.png%3Falt%3Dmedia%26token%3D2e3613f6-1d1e-42af-a56f-f22f6ee6d17d&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=73155a67&#x26;sv=1" alt=""><figcaption></figcaption></figure>

2. In the **Add metaobject definition** page, give this metaobject a **Name** (Color) and 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://docs.foxecom.com/~gitbook/image?url=https%3A%2F%2F1836495117-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FOdebKCa6IK9qfbdvSKj0%252Fuploads%252FvgnsC2mMyIFteLhBEjMn%252Fimage.png%3Falt%3Dmedia%26token%3D15e27530-3717-4a9b-a30a-25449fb49ba6&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=24add199&#x26;sv=1" alt=""><figcaption></figcaption></figure>

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

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 step, 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://docs.foxecom.com/~gitbook/image?url=https%3A%2F%2F1836495117-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FOdebKCa6IK9qfbdvSKj0%252Fuploads%252FDwu7v8WHSNbNXExzQjpv%252Fimage.png%3Falt%3Dmedia%26token%3D349486b2-a9ad-4473-bf1f-6e2c3e0083c5&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=4ea98354&#x26;sv=1" 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://docs.foxecom.com/~gitbook/image?url=https%3A%2F%2F1836495117-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FOdebKCa6IK9qfbdvSKj0%252Fuploads%252FsX3nteV82dSVg7D1E1oS%252Fimage.png%3Falt%3Dmedia%26token%3D43b953f9-9b01-4e85-b6a5-9d75debdda36&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=a1feebcc&#x26;sv=1" 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://docs.foxecom.com/~gitbook/image?url=https%3A%2F%2F1836495117-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FOdebKCa6IK9qfbdvSKj0%252Fuploads%252FKYH0Bqzu08E1GsjLIgBx%252Fimage.png%3Falt%3Dmedia%26token%3D9145051e-0285-40b3-98f7-655660b03c2d&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=bab4ffaa&#x26;sv=1" alt=""><figcaption></figcaption></figure>

3. Click **Save**.

#### **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://docs.foxecom.com/~gitbook/image?url=https%3A%2F%2F1836495117-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FOdebKCa6IK9qfbdvSKj0%252Fuploads%252F12xUDgDUc9VzKiZKPQDb%252Fimage.png%3Falt%3Dmedia%26token%3Dc326d33b-0802-4864-bc1c-dfd748f07f8e&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=701a6d72&#x26;sv=1" alt=""><figcaption></figcaption></figure>

<figure><img src="https://720269760-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSnkJrgCgnPuM88XGWwwm%2Fuploads%2FL2UGDh3nRYO0rixzNjl2%2Fimage.png?alt=media&#x26;token=d604718e-4341-4a10-bcda-70238abd5dbc" 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, set your metafield definition to allow a **List of entries**.

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://docs.foxecom.com/~gitbook/image?url=https%3A%2F%2F1836495117-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FOdebKCa6IK9qfbdvSKj0%252Fuploads%252FRfHXIehgwqZu7sQx4J6q%252Fimage.png%3Falt%3Dmedia%26token%3D85db905d-d185-4e52-a8f8-46c387f19710&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=7087347f&#x26;sv=1" 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://docs.foxecom.com/~gitbook/image?url=https%3A%2F%2F1836495117-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FOdebKCa6IK9qfbdvSKj0%252Fuploads%252FB8HQzjSWaVzaw48HBL3t%252Fimage.png%3Falt%3Dmedia%26token%3Db52461ca-f880-429b-bcaa-fc49f2b7ed65&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=2c4d5692&#x26;sv=1" alt=""><figcaption></figcaption></figure>

3. Click **Save**.

#### **After you assign the metafield to products/ variants, 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 choose an existing filter.
3. Click the **Source** field > 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://docs.foxecom.com/~gitbook/image?url=https%3A%2F%2F1836495117-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FOdebKCa6IK9qfbdvSKj0%252Fuploads%252F89nuqEj3YCaNVMxUmXwZ%252Fimage.png%3Falt%3Dmedia%26token%3D0289a22f-43ff-41a8-8c53-193f259322a0&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=9cd19275&#x26;sv=1" alt=""><figcaption></figcaption></figure>

* Choose **Image** for icons, logos, or other graphics that shouldn't be cropped.&#x20;
* Select an image field for the **Image**.

<figure><img src="https://docs.foxecom.com/~gitbook/image?url=https%3A%2F%2F1836495117-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FOdebKCa6IK9qfbdvSKj0%252Fuploads%252FYsmF0YbWumVQUHuK8ylZ%252Fimage.png%3Falt%3Dmedia%26token%3D237c86ac-4def-4219-9c90-0c48ff51fab1&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=4e4693e4&#x26;sv=1" alt=""><figcaption></figcaption></figure>

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

Themes often display a swatch's image before its color.&#x20;

For swatch displays, if you activate both **Swatch pattern** and **Swatch color**, the color is 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://720269760-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSnkJrgCgnPuM88XGWwwm%2Fuploads%2FT8TzEdMX6f4mUFA2nyPh%2Fimage.png?alt=media&#x26;token=758cc84d-7f27-4828-9df0-3d378c80d24e" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Swatch color" %}

<figure><img src="https://720269760-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSnkJrgCgnPuM88XGWwwm%2Fuploads%2F36bn5gbv949zWkIF7Fra%2Fimage.png?alt=media&#x26;token=588d84ce-eced-4dbf-92f2-6b7ab1ac9171" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}
