Personalized checkout and custom promotions with Shopify Scripts
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?
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
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024