How to display total striketrough price on the cart (I am using - UpCart Cart Drawer)

How to display total striketrough price on the cart (I am using - UpCart Cart Drawer)

WalletAces
Tourist
9 0 3

Screenshot 2024-07-28 at 13.41.45.png

Screenshot 2024-07-28 at 13.43.03.png

Can someone help me write HTML code to add a (total strikethrough price) to my cart at the bottom?

(I am using - UpCart Cart Drawer)

Reply 1 (1)

Asad-Mahmood
Shopify Partner
321 53 63

You can use liquid code to get the total price without discount and then show that with strikethrough

<!-- Add this to the cart summary section where the total price is displayed -->
{% assign original_total_price = 0 %}
{% for item in cart.items %}
  {% assign original_total_price = original_total_price | plus: item.original_line_price %}
{% endfor %}

<div class="cart-total">
  <p>Total: <span style="text-decoration: line-through;">{{ original_total_price | money }}</span> {{ cart.total_price | money }}</p>
</div>
If my solution has been helpful, you can consider supporting me via Buy Me a Coffee.
Hire me: asadmahmood8470@gmail.com
WhatsApp
Fiver