Shopify themes, liquid, logos, and UX
We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more
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