Shopify themes, liquid, logos, and UX
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
We want the price of all variants to show on the collection page. As of right now, it only shows the lowest price and does not indicate there are any other variants until you click on the product page. We would like it to show the lowest to highest price on the collections page. Thank you for your help.
Hi @chase1717,
Please go to the file containing the code to display the price, 'price' can be found in the snippets.
example with Dawn theme
Then add the code:
{% if product.price_varies %}
{{ product.price_min | money }} - {{ product.price_max | money }}
{% else %}
{{ product.price | money }}
{% endif %}
Hope it helps!
Hello,
I tried adding the code to the 'product-price.liquid', and it did show the range of prices but also displayed the lowest price above that, along with all other products that do not have a range of prices (so there were two of the same prices on top of each other). Should I have made a new snippet to add the code to? Thank you!
Hi @chase1717,
It helps to display max and min prices, if you want to list all prices, please change the code:
{%- if product.price_varies -%}
{%- assign variants = product.variants | sort: 'price' -%}
{%- assign check = -1 -%}
{%- for variant in variants -%}
{%- if check != variant.price -%}
{{ variant.price | money }}
{%- assign check = variant.price -%}
{%- endif -%}
{%- endfor -%}
{%- else -%}
{{ product.price | money }}
{%- endif -%}
Hope it helps!