Product label sale on single product page

I wanted to add product label sale on the single product page, and I managed to do this on with the following code in product.template.liquid

{% if settings.product_grid_label_sale_style == 'text' %}

{{ 'products.product.on_sale' | t }}

{% else %}

{{ product.compare_at_price | minus: product.price | times: 100.0 | divided_by: product.compare_at_price | round }}%

{% endif %}

I wrote code below

and inside

Everything works fine when product have discount as you can see here https://prnt.sc/11c575x

But when I have product page without discount I get this error https://prnt.sc/11c59bm

I do have product-price liquid file too. My theme is Venue.

1 Like

@Blok64IT Please provide the URL of your store and if it is password protected please share the password too. Thanks