collection template renders the collection page, which lists all products within a collection.
collection template is located in the
templates directory of the theme:
You should include the collection object in your
collection template or a section inside of the template.
The collection objectAnchor link to section titled "The collection object"
You can access the Liquid
collection object to display the collection details.
When working with the
collection template, you should familiarize yourself with the following:
Filter collectionsAnchor link to section titled "Filter collections"
You can use storefront filtering to filter collections into smaller subsets of products.
Sort products in a collectionAnchor link to section titled "Sort products in a collection"
You can choose the order that products are sorted in through the
sort_by URL parameter on collection pages:
Through the collection object, you can access the following:
- The available options with the
- The currently selected option, if one is selected, with the
- The default option with the
You can output the available options in a
Paginate productsAnchor link to section titled "Paginate products"
Products can be accessed through the
products attribute of the collection object, and have a limit of 50 per page. For this reason, you should paginate a collection’s products to ensure that they’re all accessible: