Discount help needed

Solved
Highlighted
Excursionist
50 0 3

Hello,

I followed this guide: https://shopify.dev/docs/themes/liquid/reference/filters/math-filters to display discount table prices on products pages.

It works well but:

If the price is £2.61 it displays correct, if it's £2.60 it displays as £2.6 without a 0.

See screenshot images attached of code and display, help is very appreciated. 

 

displaydisplaycodecode

0 Likes
Highlighted
Shopify Expert
781 64 175

This is an accepted solution.

Try adding the | money_with_currency filter to the end of your liquid code (after the round: 2). Then you can remove the hard-coded pound symbol then too.

I think that should do it.

Founder of Speed Boostr (Shopify optimization and dev agency).
Creator of Theme Scientist (A/B testing app).
Creator of Order Automator (app that auto tags + fulfills orders, send emails).
Creator of Tip Jar (add a tip button to your store).
Creator of Shopify Analyzer (free performance analysis tool).
My team also builds custom apps and automated solutions.
Enjoy the adventure!
1 Like
Highlighted
Excursionist
50 0 3

@JoesIdeas Brill, I got it to work from your help! On my theme, I added just the {{money}} filter as {{money_with_currency}} had GBP afterwards! Thank you!

1 Like