Shopify themes, liquid, logos, and UX
I keep running into errors when I try and add .01 to price so that the sale badge does not show up if the prices are $0.01 difference:
assign on_sale = false
if product.compare_at_price > product.price
assign on_sale = true
endif
Can I not just add plus: 0.01 to product.compare_at_price? Can someone please help with the language?
{%- liquid
assign on_sale = false
if product.compare_at_price != null
assign difference = product.price | minus: product.compare_at_price | round : 2
if difference > 0.01
assign on_sale = true
endif
endif
-%}
User | RANK |
---|---|
74 | |
74 | |
62 | |
59 | |
41 |
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