How to show "total savings" on cart and checkout page?

Topic summary

A merchant wants to display total savings from sale items on both cart and checkout pages for a Debut theme store.

Solution for Cart Page:

  • A Liquid code snippet was provided that calculates savings by comparing compare_at_price to actual price
  • The code loops through cart items, calculates per-item savings multiplied by quantity, and displays the total
  • Implementation requires placing the code in the cart template file

Checkout Page Challenge:

  • Displaying savings on checkout requires Shopify Plus with checkout customization access
  • One user has it working on cart but needs guidance for checkout implementation
  • May require paid apps or professional help depending on the approach

Enhancement:

  • A conditional statement was added to only show savings when discount items are present in cart
  • This prevents displaying “$0 saved” when no sale items exist

The discussion remains open regarding specific checkout page implementation details.

Summarized with AI on November 4. AI used: claude-sonnet-4-5-20250929.

Hello Shopify community,

I’m looking to add “total savings” onto the cart and checkout page of one of my client’s store.

Essentially, once a visitor is on the cart and checkout page. I want to show the amount they’ve saved from items being on sale.

How can I make this happen? If I need professional help to do so. I’m totally fine with that.

This is a new store and we’re using Debut theme.

Thank you

1 Like

Hi,
You can print total savings on the cart page using below code.

{% assign total_saving = 0 %}
{% for item in cart.items %}
  {% if item.variant.compare_at_price > item.variant.price %}
  	{% assign saving = item.variant.compare_at_price | minus: item.variant.price | times: item.quantity %}
  	{% assign total_saving = saving | plus: total_saving %}
  {% endif %}
{% endfor %}

You Saved: {{ total_saving }}

For showing the saving total on the checkout page, you need an Shopify plus account to make any changes or need to depend on some paid apps.

Hello, I have Shopify Plus account (with checkout enabled to edit) and wondering how I can display the Total Savings on Checkout?

I already have it working on Cart, but unsure how to get it to work on checkout.

Please advise.

Thanks!

where do i exactly put this code please?

1 Like

where you want to show the saving amount in the cart find the cart code file

This works perfectly!

How could you apply the -if/else- statement so that it only displays when discount items are present in the cart?

{% assign total_saving = 0 %}
{% for item in cart.items %}
{% if item.variant.compare_at_price and item.variant.compare_at_price > item.variant.price %}
{% assign saving = (item.variant.compare_at_price | minus: item.variant.price) | times: item.quantity %}
{% assign total_saving = total_saving | plus: saving %}
{% endif %}
{% endfor %}

{% if total_saving > 0 %}
You Saved: {{ total_saving | money }}
{% else %}

{% endif %}