Re: Product sale price in Cart

How can I display the original price on the cart page?

juan_bw
Shopify Partner
5 0 0

Note this product has a sale price

https://marysquare.com/products/tshirt-more-love?variant=42123645878480

However, if you add it you won't see the original price on the cart.

 

I'm trying to add the original price with a line trough as it is on the product page but the original price doesn't even come to the fronted from the cart API request: https://i.imgur.com/JxOy2Rc.png

 

Is there a way for obtaining the original price from the cart page?

Reply 1 (1)

playwright-mike
Shopify Partner
72 18 33

Hi @juan_bw, this has more to do with the cart page than Shopify Scripts (which is focused on checkout). 

 

However, a similar question and answer has been posted here: https://community.shopify.com/c/technical-q-a/display-compare-at-price-saving-on-the-cart-and-checko...

 

For the cart page, find where the current item price is and update to something like this:

{{ item.final_price | money }}
{% if item.variant.compare_at_price > item.variant.price %}
  <s>{{ item.variant.compare_at_price | money }}</s>
{% endif %}

 

For savings, you can calculate like this:

{% assign savings = item.variant.compare_at_price | minus: item.final_price %}
You're saving {{ savings | money }}!

 

Let me know if that was helpful,

Matthew

Playwright | Create Shopify Scripts without writing code | https://playwrightapp.com
- Was my reply helpful? Please Like and Accept Solution.