Join us for an upcoming Shopify Partner webinar on February 27, 2024. Discover the latest Checkout Extensibility features, and deep dive on improvements to Shopify Functions and Web Pixels. Register now for either the 10am EST or 2pm EST sessions.

How to get the cheapest product price from whole collection

nox5692
Shopify Partner
1 0 1

Hello everyone, I'm having troubles with my price range filter. As you can see form the reference picture, the filter's default value is set from 0 to the most expensive product's price (which is accessed by {{ filter.range_max }} ), however, my CHEAPEST product in the collection costs about 500, not 0! How do I access to lowest price in the collection? There seems to be no direct liquid object such as {{ filter.range_max }}.

 

Screenshot 2022-06-27 at 15.15.49.png

 

 

 

 

 

 

This is my current condition for the lower value of the "from" input:

 

 

{% if filter.min_value.value -%} value="{{ filter.min_value.value | money_without_currency | replace: ',', '' }}" {% else %} value="0" {%- endif %}

 

 

Any help will be very appreciated, thank you!

Reply 1 (1)

Dirk
Shopify Staff
2167 243 491

Hey, @nox5692 

 

I'm not formally trained in code to provide you with an exact solution to have a dynamic price filter that starts at the collection's lowest product price. However, I'm confident one of our Shopify experts would be able to accomplish this at a reasonable price.

 

If there is anything else I can help you with, please let me know.

Dirk | Social Care @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog