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?
Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024Digital marketers and app developers have tracked activity in apps and websites for yea...
By Ollie Mar 13, 2024February was an exciting month with Shopify Editions, informative webinars, and more! F...
By JasonH Mar 7, 2024