Shopify themes, liquid, logos, and UX
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
Solved! Go to the solution
This is an accepted solution.
I hope so too and I very much appreciate your help. 🙏
@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.
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.
@WendyC - on which theme? any chance that they used any app?
No just code. You can find the solution here in the community.
@WendyC - ok I will search it, you too please let me know if you find any
Hi @WendyC
do you want to show the price like this image?
correct
Hi @WendyC
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
This is an accepted solution.
I hope so too and I very much appreciate your help. 🙏
Hello thank you for the code. Is there a way to remove the USD?
The year-end shopping spree is around the corner! Is your online store ready for the ...
By JasonH Nov 10, 2024We recently spoke with Zopi developers @Zopi about how dropshipping businesses can enha...
By JasonH Oct 23, 2024A big shout out to all of the merchants who participated in our AMA with 2H Media: Holi...
By Jacqui Oct 21, 2024