What's your biggest current challenge? Have your say in Community Polls along the right column.

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

Solved

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

WendyC
Excursionist
12 1 1

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

Accepted Solution (1)
WendyC
Excursionist
12 1 1

This is an accepted solution.

I hope so too and I very much appreciate your help. 🙏

View solution in original post

Replies 12 (12)

suyash1
Shopify Partner
10222 1262 1601

@WendyC - 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.

To build shopify pages use PAGEFLY | Contact me - suyash.patankar@gmail.com , My timezone is GMT+5:30.
WendyC
Excursionist
12 1 1

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. 

suyash1
Shopify Partner
10222 1262 1601

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

To build shopify pages use PAGEFLY | Contact me - suyash.patankar@gmail.com , My timezone is GMT+5:30.
WendyC
Excursionist
12 1 1

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

suyash1
Shopify Partner
10222 1262 1601

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

To build shopify pages use PAGEFLY | Contact me - suyash.patankar@gmail.com , My timezone is GMT+5:30.

ExpertRookie
Shopify Partner
1518 249 323

Hi @WendyC 
do you want to show the price like this image? expert-rookie-1 2022-10-31 14-27-23.jpg

- Was my reply helpful? Please Like and Accept Solution to let me know!
- Want to modify or custom changes on store Hire me.
- Feel free to contact me on expert.rookie.team@gmail.com regarding any help.
WendyC
Excursionist
12 1 1

correct

 

ExpertRookie
Shopify Partner
1518 249 323

Hi @WendyC 
please follow this image and update the code in file price.liquid with this code
expert-rookie-1 · Edit ~ Sense · Shopify 2022-10-31 14-33-00.jpg

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
- Was my reply helpful? Please Like and Accept Solution to let me know!
- Want to modify or custom changes on store Hire me.
- Feel free to contact me on expert.rookie.team@gmail.com regarding any help.
WendyC
Excursionist
12 1 1

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. 

ExpertRookie
Shopify Partner
1518 249 323

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

- Was my reply helpful? Please Like and Accept Solution to let me know!
- Want to modify or custom changes on store Hire me.
- Feel free to contact me on expert.rookie.team@gmail.com regarding any help.
WendyC
Excursionist
12 1 1

This is an accepted solution.

I hope so too and I very much appreciate your help. 🙏

SpankysLoot
Visitor
2 0 0

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