Discussing Shopify Functions development, deployment, and usage in Shopify apps.
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
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
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?