Show price ranges in collections list

Show price ranges in collections list

manter
Tourist
12 0 4

Hello,

 

Is there an easy way to show price ranges in the collections list? I've installed app that makes discounts for product bundles, but currently the customers see only the highest price in the collections page.

 

Page:

https://holycup.lt/collections/stikliniu-kolekcija

 

Thanks!


Replies 2 (2)

Tal19
Shopify Partner
116 19 18

If you want and know how to customize the theme code, you can do something like that:

{% for product in collection.products %}
    {% assign product_prices = product.price | money_without_currency | split: '-' %}
    {% assign product_min_price = product_prices[0] | plus: 0 %}
    {% assign product_max_price = product_prices[1] | plus: 0 %}
    {% if forloop.first %}
        {% assign collection_min_price = product_min_price %}
        {% assign collection_max_price = product_max_price %}
    {% else %}
        {% if product_min_price < collection_min_price %}
            {% assign collection_min_price = product_min_price %}
        {% endif %}
        {% if product_max_price > collection_max_price %}
            {% assign collection_max_price = product_max_price %}
        {% endif %}
    {% endif %}
{% endfor %}

Price Range: {{ collection_min_price | money }} - {{ collection_max_price | money }}
Need Shopify Development, Customization, or POS Support? PM Me!
manter
Tourist
12 0 4

Hello, thank you, may I ask you where exactly I should add this code? Thanks!