Product Card show only "from" price [Dawn Theme]

Hi there,

The product cards on my Shopify site are currently showing the price as “from”.

What I would like to achieve is that the price will show a range (from - to) based on the variants of that products.

How do I go about that?

Thank you in advance for your help.

The store can be visited at www.meadows.sydney

@Wendy_C_Photo - by default shopify do not have an option to get the last variant of the product, and hence it does not have an option to set the range as we do not know the upper limit.

Please check if you get any app for this or you can contact shopify support for this.

Hi Suyash thank you for coming back to me. Yes I had understood that. I was hoping that there may be some code I could cut n paste to modify the way the card displays the price. I have seen this as a solution for a different theme.

@Wendy_C_Photo - on which theme? any chance that they used any app?

No just code. You can find the solution here in the community.

1 Like

@Wendy_C_Photo - ok I will search it, you too please let me know if you find any

Hi @Wendy_C_Photo
do you want to show the price like this image?

correct

Hi @Wendy_C_Photo
please follow this image and update the code in file price.liquid with this code

if target == product and product.price_varies
    assign max_money = 0
    for variant in product.variants
      assign variant_price = variant.price
      assign max_money = variant_price | at_least: max_money
    endfor
   assign max_money = max_money | money
   assign money_price = 'products.product.price.from_price_html' | t: price: money_price | append: 'to' | append: max_money 
  endif

Thank you very much for your reply. In the end I got someone to make the changes for me, so I did not get to try this.

Sound great, But I hope the solution can help someone in forum

1 Like

I hope so too and I very much appreciate your help. :folded_hands:

Hello thank you for the code. Is there a way to remove the USD?