We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

Show price ranges in collections list

Show price ranges in collections list

manter
Excursionist
18 0 7

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
144 27 29

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
Excursionist
18 0 7

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