Changed sale tag to save tag- wont show accurate difference

I changed my sales tag as per the code here

https://community.shopify.com/c/shopify-design/how-to-make-a-quot-sale-quot-label-show-quot-save-x-quot-instead/td-p/2310307

But now for each of my variant, the amount in the save tag stays the same. What changes should I make?

https://koralcare.in/products/sheets-combo-pack

Hi @workhere ,

We do need to add custom code for this.

Let me know if you need help with the custom code.

Thank you

@workhere Please remove the existing code and use below code,

{%- assign savings = product.selected_or_first_available_variant.compare_at_price | minus: product.selected_or_first_available_variant.price -%}
Save ${{ savings | money_without_trailing_zeros }}

Now, the price will change based on variant selection, see below images for reference.

Please provide your support by click “Like” and “Accepted” if our solution works for you. Thanks for your support.

Thanks so much for prompt reply, that works