Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hi everyone,
I'm trying to modify my `card-product.liquid` file to display the amount of money saved on each product instead of the default "Sale" label. I followed the instructions and code provided by an AI, and also consulted the guide in this [Shopify Community post](https://community.shopify.com/c/shopify-design/how-to-make-a-quot-sale-quot-label-show-quot-save-x-q...), but it's not working as expected.
Here's the line of code I added to my script:
```liquid
{%- assign savings = card_product.compare_at_price | minus: card_product.price -%}
Save ${{ savings }}
```
I also tried the revised code to calculate and show the percentage savings:
```liquid
{%- assign savings = card_product.compare_at_price | minus: card_product.price -%}
{%- if card_product.compare_at_price > 0 -%}
{%- assign savings_percentage = savings | times: 100 | divided_by: card_product.compare_at_price -%}
Save {{ savings_percentage | round: 2 }}%
{%- endif -%}
```
Despite adding the `compare_at_price` and `price` for each variant in bulk edit, the amount of money saved doesn't display live on my product cards.
Can someone please help me figure out what I'm doing wrong? Any advice on how to correctly implement this feature would be greatly appreciated!
Thank you!
Discover how to increase customer engagement on your store with articles from Shopify A...
By Jacqui Apr 23, 2025Hey Community 👋 Did you know that March 15th is National Everything You Think Is W...
By JasonH Apr 1, 2025Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025