Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hi all,
I have this Error on my products which are on sale. I couldnt find the error. Actually I dont know where to find and correct it. Could you please help me?
can you please share your site link and if you can give access of your site i will fix it for you
Go to Online Store -> Themes -> Edit code. Look for snippets and find card-product.liquid
On the line 133 something is not quite right. Would you mind sending here lines 130-135?
>
{{ product_card_product.compare_at_price | minus: product_card_product.price | times: 100 | divided_by: product_card_product.compare_at_price }}% OFF
</span>
replace with this code
{% if product_card_product.compare_at_price > 0 %} {{ product_card_product.compare_at_price | minus: product_card_product.price | times: 100 | divided_by: product_card_product.compare_at_price }}% OFF {% else %} 0% OFF {% endif %}
Okay it worked but now there is 0% off...
{% if product.compare_at_price > 0 %} {{ product.compare_at_price | minus: product.price | times: 100 | divided_by: product.compare_at_price }}% OFF {% else %} {% endif %}
I am guessing this is what you need.
Now it looks like this: but its actually not 30%... 😄
Maybe you can help me also with this: I tried everything but its not wirking.. 😄 just want to center the title... Thanks in advance
Hi. I have same problem with coding of product-price.liquid. Would you be able to advise me the correct using I should replace that line with? Currently I have
<span class="badge sale-badge" data-label-sale> -{{ product.variants[0].compare_at_price | minus:product.variants[0].price | times:100 | divided_by:product.variants[0].compare_at_price }}%</span>
Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025Discover opportunities to improve SEO with new guidance available from Shopify’s growth...
By Jacqui May 1, 2025