Showing Min and Max Price Range on Debut Theme

New Member
4 0 0

Hi,

 

I am trying to show the min and max price under each product that has variants that have different prices (e.g. From $5 To $10).  There are a few old discussions that explained how to do this, but I haven't gotten the code to work in the latest version of the Debut theme.

 

After some testing, it looks like the money_price_min and money_price_max variables aren't holding any values despite the code I added below.

 

Any help would be appreciated. Thanks in advance!

 

Here are the changes I made to product-price.liquid:

Added under  {%- assign price = variant.price -%}

{%- assign min_price = variant.price_min -%}
{%- assign max_price = variant.price_max -%}

 

Added under {%- assign money_price = price | money -%}
{%- assign money_price_min = min_price | money -%}
{%- assign money_price_max = max_price | money -%}

 

Adjusted price display section to:

{% if available %}
        {% if compare_at_price > price %}
          <span class="price-item price-item--regular" data-regular-price>
            {{ compare_at_price | money }}
          </span>
        {% else %}
        {% if money_price_min < money_price_max %}
      <span class="price-item price-item--regular" data-regular-price>
        From: {{ money_price_min }} To: {{ money_price_max }}
            </span>
        {% else %}
          <span class="price-item price-item--regular" data-regular-price>
            {{ money_price }}
          </span>
      {% endif %}
        {% endif %}
      {% else %}
        <span class="price-item price-item--regular" data-regular-price>
          {{ 'products.product.sold_out' | t }}
        </span>
      {% endif %}

 

 

0 Likes