Add total savings to Subtotal

Topic summary

A user seeks to display total savings (based on compare-at prices) in the cart subtotal section, showing the original price with a strikethrough alongside the discounted price.

Initial Solution:

  • Code provided to calculate total compare-at price across all cart items
  • Uses Liquid templating to loop through cart items and sum compare prices
  • Applies HTML <s> tag for strikethrough styling

Implementation Details:

  • Works in main cart page (Main-Cart-items.liquid)
  • Original poster successfully implemented the solution
  • Prefers automatic display over discount code apps

Ongoing Issue:

  • Another user (andreas23) reports the code doesn’t work in cart-drawer.liquid
  • Product page shows correct compare prices (e.g., $200 $119)
  • Cart drawer displays incorrect pricing, preventing customers from seeing the comparison
  • Issue remains unresolved for the cart drawer implementation
Summarized with AI on November 5. AI used: claude-sonnet-4-5-20250929.

Hi! sorry I tried copying the code you provided in the cart-drawer.liquid

as :

{% assign subtotalCompare = 0 %}
{% for item in cart.items %}
{% if item.variant.compare_at_price > item.variant.price %}
{% assign subtotalCompare = subtotalCompare | plus: item.variant.compare_at_price %}
{% endif %}
{% endfor %}

{{ subtotalCompare | money }}
{{ subtotalCompare | money }}

but is not working! the price in the landing page still shows the compared price $119 instead of $200, but once I add the product to the cart I do not see the comparison which is not good. I want customers to see that.. any help? thank you @Sean_Morton34

image 1. Showing the cart drawer
image 2. Showing the prices on product page