Shopify themes, liquid, logos, and UX
I Have this code that display a percentage saved.
But if i have a variant with a diffrent price or compraed price, the number percantage wont update.
how can i make it update based on the variant?
{%- when 'price' -%} <div class="{{ spacing_classes }}" style="--custom-margin-bottom: {{ block.settings.margin_bottom }}px" {{ block.shopify_attributes }}> <div class="product-price-size--{{ block.settings.price_font }} product-price-group"> <span class="visually-hidden">{{ 'products.general.sale_price' | t }}</span> <span style="color:#fff;background-color:#000;border-radius:20px;padding:0 7px;margin-left:4%;font-weight:bold;font-size:15px;margin-bottom:5px; height: 25px"> {% if product.compare_at_price_max > product.price %} SAVE {{ product.compare_at_price_max | minus: product.price | times: 100.0 | divided_by: product.compare_at_price_max | money_without_currency | times: 100 | remove: '.0'}}% {% endif %} </span>
Hi @orhl1234 ,
We do need to add custom code for this.
Let me know if you need any assistance.
Thank you
i would love to
June brought summer energy to our community. Members jumped in with solutions, clicked ...
By JasonH Jun 5, 2025Learn 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, 2025