I'd like the prices of products with variants to be displayed as a range from min-max.
My theme is Supply.
This is price.liquid code
{% assign formatted_price = price | money %} {% comment %} Unless this store uses multiple currencies, if we apply a special style to cents, we will wrap them in a sup (superscript) element. {% endcomment %} {% unless shop.money_format contains 'money' or shop.money_format contains '.' %} {% if settings.superscript_decimals %} {% if shop.money_format contains '{{amount}}' or shop.money_format contains '{{ amount }}' %} {% capture formatted_price %}{{ formatted_price | replace: '.','<sup>' }}</sup>{% endcapture %} {% elsif shop.money_format contains '{{amount_with_comma_separator}}' or shop.money_format contains '{{ amount_with_comma_separator }}' %} {% capture formatted_price %}{{ formatted_price | replace: ',','<sup>' }}</sup>{% endcapture %} {% endif %} {% endif %} {% endunless %} <small aria-hidden="true">{{ formatted_price }}</small> <span class="visually-hidden">{{ price | money }}</span>
thanks for any help
hi,@@Polsan
hope you doing well
try this for min and max price show
{{ product.price_min | money }} - {{ product.price_max | money }}
if any problem
feel to free to reach out
Hi @Qualitycheck , thanks but that didn't work so I have just replaced the whole code with this one from another thread
{%- assign money_price_min = product.price_min | money -%} {%- assign money_price_max = product.price_max | money -%} {% if product.title %} {%- assign compare_at_price = product.compare_at_price -%} {%- assign price = product.price -%} {%- assign price_varies = product.price_varies -%} {%- assign available = product.available -%} {% else %} {%- assign compare_at_price = 1999 -%} {%- assign price = 1999 -%} {%- assign price_varies = true -%} {%- assign available = true -%} {% endif %} {%- assign money_price = price | money -%} {% if compare_at_price > price %} <span class="visually-hidden">{{ 'products.product.regular_price' | t }}</span> <s class="product-price__price">{{ compare_at_price | money }}</s> <span class="product-price__price product-price__sale"> {%- if price_varies -%} {{ money_price_min }} - {{ money_price_max }} {%- else -%} {{ money_price }} {%- endif -%} </span> {% if settings.show_saved_amount and settings.show_discount_amount == 'money_save' %} <span class="salePrice sale-tag large"> {% assign sale = product.compare_at_price | minus: product.price | money %} {{ 'products.product.on_save_like_price' | t }} {{sale}} </span> {% endif %} {% else %} <span class="visually-hidden">{{ 'products.product.regular_price' | t }}</span> <span class="product-price__price"> {%- if price_varies -%} {{ money_price_min }} - {{ money_price_max }} {%- else -%} {{ money_price }} {%- endif -%} </span> {% endif %}
User | Count |
---|---|
22 | |
16 | |
15 | |
15 | |
14 |