简体   繁体   中英

Force discount in cart (Shopify)

I've been looking into an issue for the last couple of days and I can't seem to find how to do it. From what I understood, Shopify applies discounts directly to checkout. What I would like to do is to somehow force the discounted price to appear in the cart too, because I feel that a significant percentage of people abandon their carts before checkout because of this.

https://shopify.dev/docs/themes/liquid/reference/objects/cart I tried everything from here, but

{{ discount_application.total_allocated_amount | money }} is not working

{{ cart.total_discount | money }} also not working

It is not that it shows wrong values, it's like Shopify does not recognize those attributes at all.

Can someone help me regarding this matter? Thank you and I hope you all have a great day!

These cart object attributes are related to automatic discounts (like buy X+Y get Z for free). You won't be able to display values related to "manual" discounts applied by user at checkout as it is applied... at checkout.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM