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!
Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025