Quantcast
Channel: Opinion: Shopify Community - Shopify Design
Viewing all articles
Browse latest Browse all 57838

Caroline Schnapp commented on Sort "All Products" collection by product type

$
0
0

Do you guys have a lot of products in your Catalog?

There's a way to sort the Catalog by type in collection.liquid, but that would only work to sort items on the current page, not sorting all items across all pages. If your have more than one page in your collection, that won't work. 

In collection.liquid, you would replace this:

{% for product in collection.products %}

with:

{% assign products = collection.products %}
{% if collection.handle == 'all' %}
  {% assign products = products | sort: 'type' %}
{% endif %}
{% for product in products %}

 


Viewing all articles
Browse latest Browse all 57838

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>