Re: Display Price of Available Variants, not Lowest Price

Display Price of Available Variants, not Lowest Price

Fish-Tank
Tourist
10 0 5

I have looked around this forum for results, and the only one I found does not make full sense to me. 

 

The problem: Our products have variants with different prices. When viewing collections, below the product image, the price is displayed. If there is only one variant, the price displayed is that variant's price. If there are multiple variants, the price is displayed as, "From $xxx", where xxx = the lowest price of all variants. 

 

We would like the price displayed to be the lowest price of available/in-stock variants, not the lowest price possible. If the lowest price possible is not in stock, customers feel tricked into a higher price. 

 

Our liquid for the section is as follows (and includes sale price stuff as well): 

 

<div class="price-box">
{% if on_sale %}
<p class="sale">
<span class="old-price"> {{ product.compare_at_price_min | money }}</span>
<span class="special-price">{% if product.price_varies %}{% include 'varies_from' %}{% endif %}{{ product.price_min | money }}</span>
</p>
{% else %}
<p class="regular-product">
<span>{% if product.price_varies %}{% if product.price_varies %}{% include 'varies_from' %}{% endif %}{{ product.price_min | money }}</span>
</p>
{% endif %}
</div>

 

 

 

I can't find anything that relates specifically to lowest available price. I am not fluent enough in the coding to create my own work-around using variant.available and other terms, if that makes sense. 

 

Any help would be appreciated!

Replies 5 (5)

JosephAMichael
Tourist
11 0 24

I'm surprised noone has resolved this yet. I'm having the same problem across multiple sites.

 

Shouldn't Shopify default the price shown to be the lowest in stock variation?

angelinaswan
Excursionist
13 0 29

I'm having a similar problem. The product collection and home page show the product on sale with the larger size / higher price as the "regular price" and the smaller size / lower price as a sale price

 

hudsonperalta
Visitor
1 0 0

 

Replace This:

 

{{ product.price | money }}

 

 

With This:

 

{{ product.selected_or_first_available_variant.price | money }}

 

 

Dclootbox
Excursionist
37 0 8

Hello.

 

What if the lowest price is on sale, then it shows 100$ (normal price) - 150$ (sale price)

sjain199925
Visitor
1 0 0

Where to replace the code?