I have multiple variants of particular products which have different prices and I would like the collection page to show that price range instead of the lowest price variant price.
Here is my price.liquid snippet:
{% 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: ‘.’,‘’ }}{% 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: ‘,’,‘’ }}{% endcapture %}
{% endif %}
{% endif %}
{% endunless %}
{{ formatted_price }}
{{ price | money }}
here is my product-grid-item.liquid snippet:
{% unless grid_item_width %}
{% assign grid_item_width = ‘large–one-quarter medium-down–one-half’ %}
{% endunless %}
{% unless image_size %}
{%- assign image_size = ‘600x600’ -%}
{% endunless %}
{% assign on_sale = false %}
{% if product.compare_at_price > product.price %}
{% assign on_sale = true %}
{% endif %}
{% assign sold_out = true %}
{% if product.available %}
{% assign sold_out = false %}
{% endif %}
{% if product.featured_image %}
{%- assign image = product.featured_image -%}
{%- assign max_width = width | plus: 0 -%}
{%- assign max_height = height | plus: 0 -%}
{%- include ‘image-logic’ with width: max_width, height: max_height -%}
{%- assign img_url = image | img_url: ‘1x1’ | replace: ‘1x1.', '{width}x.’ -%}
{% else %}
{% capture current %}{% cycle 1, 2, 3, 4 %}{% endcapture %}
{{ product.title }}
{%- if product.selected_or_first_available_variant.available and product.selected_or_first_available_variant.unit_price_measurement -%}
{% include ‘product-unit-price’, variant: product.selected_or_first_available_variant %}
{%- endif -%}
{% if section.settings.product_reviews_enable %}
{% endif %}
Thank you