Product label sale on single product page

New Member
3 0 1

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


<div class="product__label product__label--sale label label--brand">
{% if settings.product_grid_label_sale_style == 'text' %}
<p class="product__label-text label__text">{{ 'products.product.on_sale' | t }}</p>
{% else %}
<p class="product__label-text label__text">{{ product.compare_at_price | minus: product.price | times: 100.0 | divided_by: product.compare_at_price | round }}%</p>
{% endif %}

I wrote code below <h3 class="product-single__price-text js-product-price-text">

and inside <div class="product-single__price js-product-price">

Everything works fine when product have discount as you can see here

But when I have product page without discount  I get this error

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

Shopify Partner
228 46 70

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

Believes in delivering optimizing web solutions | Shopify Partner | Working as a web developer for last 8+ years.
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
Email me: