What's your biggest current challenge? Have your say in Community Polls along the right column.
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Read cart prices / totalAmount after other discounts

Read cart prices / totalAmount after other discounts

markus12
Shopify Partner
30 1 14

Function input Cart gives only the starting price of items.

 

We also need to know the price / totalAmount after other discounts have been applied. Use case: get a free gift after spending $100.

Free gift could be implemented with a function having DiscountApplicationStrategy / Priority LAST, and being able to read prices after other discounts have been applied (Shopify discounts & other function discounts).

 

Could this be made available? If not, how could one implement a free gift after spending $X ?

 

Thanks

Replies 2 (2)

Nick_Wesselman
Shopify Staff
171 43 73

As all discounts do not execute in a defined order, and Shopify decides the best allowed discount combination for the customer, it's not possible for a discount function to know what other discounts have been applied.

You can use the OrderMinimumSubtotal to implement free gift over $X.

Nick Wesselman | Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

markus12
Shopify Partner
30 1 14

Thanks. That works, but the customer experience isn't the same as seeing the cart line item with $0 cost. They see $10 for a product they didn't asked for, and only later, in cart total (if they scroll/look), they see a -$10 discount. Any suggestions on how to improve this?