Shopify themes, liquid, logos, and UX
How can i show the discount amount as a string and not a money object with shopify scripts?
This is my script:
currentPrice = line_item.line_price
newPrice = line_item.line_price * 0.80
discountAmount = currentPrice - newPrice
message = "You Save $#{discountAmount}.00!"
line_item.change_line_price(newPrice, message: message)
And it shows in output "You Save $#<Money: "88$">.00!"
Why is this so difficult to achieve? Is there no mechanism to cast this money object as a different type?
User | RANK |
---|---|
72 | |
64 | |
53 | |
52 | |
42 |
As a business owner, have you ever wondered when your customer's first impression of yo...
By Skye Jun 6, 2023We're excited to announce improvements to the threaded messaging experience in our communi...
By TyW May 31, 2023Thank you to everyone who participated in our AMA with Klaviyo. It was great to see so man...
By Jacqui May 30, 2023