0
votes

I currently have added the price range to my collection pages using this article as a guide: https://www.shopify.ca/partners/blog/collection-page-price-range

I am now trying to show the price range on my search results page but for some reason the following code is skipping over my elsif:

 {% if item.compare_at_price_min > item.price_min %}
        <p class="price sale"><span class="label">{% comment %}ly_i18n_replace_for_[ 'products.product.on_sale' | t ]_begin{% endcomment %}{% capture ly_template %}{{ 'products.product.on_sale' | t }}{% endcapture %}{% include 'ly-static-string' with '12794199' %}{% if ly_translation %}{% assign escape_content = true %}{% assign ly_template = ly_translation %}{% else %}{% assign escape_content = false %}{% endif %}{% if escape_content %}{{ ly_template | escape}}{% else %}{{ ly_template }}{% endif %}{% comment %}ly_i18n_replace_end{% endcomment %}</span> <span class="original money">{{ item.compare_at_price_min | money }}</span> <span class="money">{{ item.price_min | money }}</span></p>

       {% elsif product.price_varies %}
              <p class="price sale"><span class="label">   {{ product.price_min | money }} - {{ product.price_max | money }} </span></p>


      {% else %}


        <p class="price"><span class="money">{{ item.price_min | money }}</span></p>
      {% endif %}

I am testing on a product that is showing the price range on the collection page, and has a variable price. But the price showing on the search results page is just the lowest price option.

1

1 Answers

0
votes

Woops. in search results it seems it needs to be item.price_varies etc.