How do I show the lowest price in a collection?

Shopify Partner
8 0 4

On my homepage I want to show the minimum price of a product in my shoes collection.

Right now my code is displaying the price of all my products in my shoes collection instead of just the lowest product price in the collection. 

Here is my code so far.

{% for product in %}
    {{ product.price_min | money }}
{% endfor %}

Thanks in advance!

Replies 6 (6)
Shopify Partner
8 0 4

Well I figured it out on my own after 8 hours. I have no idea if this is best practice so if anybody has a better way to do it feel free to comment below.

In case anybody else is wondering how to do this what I did was make an array called shoesMin and then sorted it by price. Then I called the first item in the array.

{% assign shoesMin = | sort: 'price' %}
{{ shoesMin[0].price_min | money }}


If you want to get the max price in a collection you need to call the last item in the array like this.

{% assign shoesMax = | sort: 'price' %}
{{ shoesMax[-1].price_max | money }}


Shopify Expert
2925 143 1041

Hi Sean,

the way you finally did it is actually a better way, because looping over all items in a collection is not possible if there are more then 50 products in a collection.

Want to hire me to tweak a theme? Mail me at!
My post solved your problem? Like it!
Shopify Partner
8 0 4

Yeah I thought that was going to happen if I did happen to figure out a solution my origional way. Glad I looked into how arrays in Liquid work!

New Member
2 0 0

Running Shoe Fit Tips Foot size: Shoe lasts (which determine shoe sizes) vary by manufacturer and even from one shoes shoe model to another. You may need a half-size or even a full size smaller or larger than you think. If you're unsure, have shoes your feet measured. Try on shoes at the end of the day. Your feet normally swell a bit during the day's activities and will be at their largest then. This helps you avoid buying that are too small. Aim for a thumbnail's length of extra space in the toebox. The width should be snug but allow a bit of room for your foot to move without rubbing. Laces should be snug but not tight. Barefoot shoes are an exception: Heel and toes should “fit like a glove”without any extra space in the toes.


New Member
1 0 0

Dude this is awesome. Thank you so much for this code. 

Shopify Partner
17 1 15

It's possible up to 1000 products available in a collection. See the code example below:

      {% assign c_handle = collection.handle %}
      {% paginate collections[c_handle].products by 999  %}
      	{% assign shoesMin = collections[c_handle].products | sort: 'price' %}

        <div class="testMe">
          <h1>Minimum Price: {{ shoesMin[0].price | money }}</h1>

          <h1>Maximum Price: {{ shoesMin[-1].handle | money }}</h1>
      {% endpaginate %}
If you have any requirement, please email me directly to

I'm the GENUINE EXPERT that you might need today!