I suspect there is a much better way, but I use something like this, looping over all cart adjustments, checking the type of adjustment.
We use the adjustment.sourceSnapshot
for the coupon code, otherwise access the attributes on the adjustment directly, which is a Discount
model.
{% for adjustment in cart.adjustments if adjustment.type == "discount" %}
{% set isCoupon = adjustment.sourceSnapshot.code ??? false %}
{% if isCoupon %}
Coupon: {{ adjustment.sourceSnapshot.code }}
{% else %}
{{ adjustment.name }}<br />
{{ adjustment.description }}
{% endif %}
{% endfor %}
...that works.
Documentation, such as it is, is here:
https://craftcms.com/docs/commerce/3.x/adjusters.html#adjusting
And the available attributes for a discount model:
https://docs.craftcms.com/commerce/api/v3/craft-commerce-models-discount.html#app
(or src: https://github.com/craftcms/commerce/blob/master/src/models/Discount.php)
(Honestly, though, even looking at the documentation now, it's really not obvious how to come to this code....)