Show discount price in cart page

alitaha
Tourist
4 0 1

When trying to show the discount price on the cart page, after applying the discount code in checkout and going back to the cart, the discounted price is not showing, even though I am using the code described here: https://shopify.dev/tutorials/develop-theme-discounts,

 by debugging we can assert that "item.original_line_price" is equal to "item.final_line_price"

Any idea?

Oakleafinfoway
Shopify Partner
308 6 21

Hello @alitaha 

Welcome to the Shopify Community!

This is Jay from Oakleaf Infoway.

I'd be happy to assist you with the same, could you please help me with your website URL for the testing purpose?

Please add me over skype for instant communication.

Email ID& Skype ID: jay@oakleafinfoway.net

Team, *Oakleaf Infoway*
- Was my reply helpful? Please *Like* and *Accept* Solution.
- Want to customize and improve your store? Hire us.
- Feel free to contact us on Skype: live:.cid.2ca82125d1edaa5f/
Email ID: info@oakleafinfoway.com
alitaha
Tourist
4 0 1

Hey @Oakleafinfoway,

Thank you for replying, here is the website URL: https://www.califinalife.com/

I added you also on skype

0 Likes
ShopDoctors
Tourist
22 0 0

The confusing part is that there are two different types of discounts, and only one type can be displayed on the cart page by default.

If you are using Automatic Discounts, like a short-term 10 % OFF ON ALL ORDERS, these discounts can be applied automatically and can be displayed on the cart page using cart_level_discount_applications in Liquid:

{%- if cart.cart_level_discount_applications != blank -%}
<div class="order-discount-cart-wrapper">
{%- for discount_application in cart.cart_level_discount_applications -%}
<span class="order-discount order-discount--title order-discount--cart">{{- discount_application.title -}}</span>
<span class="order-discount order-discount--cart">-{{ discount_application.total_allocated_amount | money }}</span>
{%- endfor -%}
</div>
{%- endif -%}

If you want to you manual discounts, which require the customer to enter a coupon code, that's more difficult to achieve by yourself since it's only supported on the checkout page by default. There is no liquid code that will display it on the cart page. In these cases, people use an app to handle this functionality.

Discount On Cart‑ Pro Edition handles both of these cases by allowing your customers to see the automatic discounts on the cart page but also allowing them to enter manual coupons and see the result of applying them on the cart. The app can also help promote your free shipping tier and increase average order value. 

0 Likes