How can I add a total saving to my cart in Prestige Theme?

Topic summary

A user seeks to display total savings in their cart on the Prestige Theme but encounters issues with various Liquid variables like {{ total_saving }} and {{ cart.compare_at_price }}.

Solution Provided:
A community member shares working code that:

  • Loops through cart items
  • Calculates savings by comparing compare_at_price to actual price
  • Multiplies by quantity and accumulates total savings
  • Displays the result with {{ total_saving }}

Implementation Details:
The code uses Liquid logic to check if compare_at_price exceeds the variant price, then calculates and displays accumulated savings.

Status:
The original poster confirms the solution works. Several other users later request help implementing the same feature, asking where to paste the code and sharing their store URLs for assistance. The discussion remains active with ongoing support requests.

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

Good evening,

I tried to ad a total saving to my cart, but it did not work.

I tried {{ total_saving}}, {{cart.compare_at_price}}, {{cart.compare_at_price}}, {{product.compare_at_price}} still did not work.

I use the Prestige Theme, maybe someone knows anything about this.

I am really thankful for anyhelp!

Sincerely Eddy.

1 Like

@Shockpain2

Sorry you are facing this issue, it would be my pleasure to help you.

Welcome to the Shopify community! :blush:
Thanks for your good question.

Please share your site URL,
I will check out the issue and provide you a solution here.

1 Like

Hey, thank you so much for your help, but unfortunately we are creating this on a template which is offline and has on the account an active template.

Sincerely Eddy.

1 Like

@Shockpain2

sorry without checking code how can i guide you?

1 Like

Hey,

I have made the store online.

The link is: https://baminol.myshopify.com/products/test-produkt?variant=39820543426748

Thanks for your help! :slightly_smiling_face:

1 Like

@Shockpain2

thanks can you please share side cart code

1 Like

Yes of course!

{%- capture section_settings -%}
{
ā€œtypeā€: {{ settings.cart_type | json }},
ā€œitemCountā€: {{ cart.item_count }},
ā€œdrawerā€: true,
ā€œhasShippingEstimatorā€: false
}
{%- endcapture -%}

{{ 'cart.general.title' | t }} {%- render 'icon' with 'close' -%}

&nbspāœ“ Gute Wahl! Dein Artikel liegt im Warenkorb.

{%- if settings.cart_show_free_shipping_threshold -%} {%- assign threshold_in_cents = settings.cart_free_shipping_threshold | times: 100 -%}
{%- if cart.total_price >= threshold_in_cents -%}

{{- 'cart.general.free_shipping' | t -}}

{%- else -%} {%- capture remaining_amount -%}{{ cart.total_price | minus: threshold_in_cents | abs | money_without_trailing_zeros }}{%- endcapture -%}

{{- 'cart.general.free_shipping_remaining_html' | t: remaining_amount: remaining_amount -}}

{%- endif -%}
{%- endif -%}

{%- if cart.item_count == 0 -%}

{{ 'cart.general.empty' | t }}

{%- else -%}

{% render ā€˜cart-items’ %}

{%- endif -%}

{%- unless cart.item_count == 0 -%}

{%- capture shipping_and_taxes_notice -%}{{ 'cart.general.shipping_and_taxes_notice' | t }}{%- endcapture -%}

{%- if settings.cart_enable_notes or shipping_and_taxes_notices != blank -%}
{%- if settings.cart_enable_notes -%}
{%- if cart.note == blank -%}
{{ ā€˜cart.general.add_note’ | t }}
{%- else -%}
{{ ā€˜cart.general.edit_note’ | t }}
{%- endif -%}
{%- endif -%}
{%- if shipping_and_taxes_notice != blank -%}

{{ shipping_and_taxes_notice }}

{%- endif -%}

{%- if cart.cart_level_discount_applications != blank -%}
{%- for discount_application in cart.cart_level_discount_applications -%}

{%- render 'icon' with 'sale' -%} {{ 'cart.general.discount' | t }} ({{ discount_application.title }}): -{{ discount_application.total_allocated_amount | money_without_trailing_zeros }}

{%- endfor -%} {%- endif -%} {%- endif -%}

{{ 'cart.general.total' | t }}: {{ cart.total_price | money_without_trailing_zeros }}
{{ cart.general.total }}Du sparst: {{ cart.compare_at_price_max | money }}

{{ cart.general.total }}Du sparst: €{{cart.compare_at_price_max | minus: cart.price | divided_by:100}}

Kostenloser Versand nach DE :germany:

 {{- 'cart.general.checkout' | t -}}

{%- if settings.cart_enable_notes -%}

{%- if cart.note == blank -%} {{ 'cart.general.add_note' | t }} {%- else -%} {{ 'cart.general.edit_note' | t }} {%- endif -%}
{{ cart.note }}

{{ ā€˜cart.general.save_note’ | t }}

{%- endif -%}
{%- endunless -%}
1 Like

@Shockpain2

thanks for code but i need some think is missing on code bt not any issue you can do this please add 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 }}
1 Like

Thank you so much!!!

If you have any time left I would be so happy if you could take a look into my other post, about the SVG Icon.

Have a great day my friend :slightly_smiling_face:

1 Like

@Shockpain2

it’s my pleasure to help us

1 Like

Hey Ketan, where exactly we paste this code

3 Likes

Hello! did you find a solution ? Im looking for the same answer

1 Like

@CStudios @NawazGabol
oh sorry for that issue can you please share store url so i will check and let you know

Hello I am facing the same issue, could you please dm me so that I can send you my store url?

1 Like

@MaxvdH1 yes please share url so i will check and update you

My store URL is: https://www.orlaamsterdam.nl/