Discount amount & percentage - Debut Theme

Highlighted

Hi,

I made a discount label on debut theme on product page, however the code is not working dynamically when we select another variant. how can i make it dynamic please ? thank in advance

here is the code i made :

{% if variant.compare_at_price > product.price %}
<div class="dashb"> 
<span class="save">{{section.settings.disc-txt}} &nbsp;
</span>
<span class="save1"> {{ variant.compare_at_price | minus: variant.price | times: 100.0 | divided_by: variant.compare_at_price | money_without_currency | times: 100 | remove: '.0'}}%
</span> 
<span class="save2">   
({{ variant.compare_at_price | minus: product.price | money_with_currency }})
</span>
</div>  

{% endif %}
Ecom-Gurus.com The Freelance Marketplace For You
0 Likes