Hi,
Shop is on Shopify Plus.
We try to get the used discount value on the order confirmation page.
We can successfully retrieve the coupon name with
{% for discount_application in checkout.order.discount_applications %}
'coupon': {{discount_application.title | json}},
{% endfor %}
(this is part of a JS object)
This works fine. But we struggle to get the corresponding total discount value applied to the order.
Accoring to the documentation (https://shopify.dev/docs/api/liquid/objects/checkout#checkout-discounts_amount) it should be in checkout.discounts_amount.
But the documentation is not conclusive if it is an array or a number. We tested both and neither seems to be working.
In addition, we’d also like to get the discount value applied on a line_item level (if applicable).
Would appreciate if someone could point me in the right direction.
Thank you!