Order Printer App: Automatic Discount Codes

Hello, how can I print the automatic discount code applied? The following code works when the discount code is manually entered by the customer at checkout, but I cannot get it to show when an AUTOMATIC discount was applied to the order.

Order Placed {{ created_at | date: "%m/%d/%Y" }}
ORDER {{ order_name }}



# of online orders: {{ customer.orders_count }}

Linea Intima Logo
{{ shop.address }}
{{ shop.city }} {{ shop.province_code }} {{ shop.zip | upcase }}
{{ shop.country }}

Item Details

{% if show_line_item_taxes %} {% endif %} {% for line_item in line_items %} {% if line_item.tax_lines %} {% endif %} {% endfor %}
Qty SKU ItemTaxesPrice
{{ line_item.quantity }} x {{ line_item.sku }} {{ line_item.title }} {% for tax_line in line_item.tax_lines %} {{ tax_line.price | money }} {{ tax_line.title }}
{% endfor %}
{{ line_item.price | money }}

{% if transactions.size > 1 %}

Transaction Details

{% for transaction in transactions %} {% endfor %}
Type Amount Kind Status
{{ transaction.gateway | payment_method }} {{ transaction.amount | money }} {{ transaction.kind }} {{ transaction.status }}
{% endif %}

Payment Details

{% if total_discounts > 0 %} {% elsif total_discounts < 0 %} {% endif %}

{% if shipping_address %}

{% endif %} {% if total_paid != total_price %} {% endif %}
Subtotal: {{ subtotal_price | plus: total_discounts | money }}
Discount: {% for discount in discounts %}"{{ discount.code }}"{%endfor%} ({{ total_discounts | money }})
Discounted Subtotal: {{ subtotal_price | money }}
Subtotal: {{ subtotal_price | money }}
Shipping: {{ shipping_price | money }}
Tax: {{ tax_price | money }}
Total price: {{ total_price | money }}
Total paid: {{ total_paid | money }}
Total Refunded: ({{ total_price | minus: total_paid | money }})

{% if note %}

Note

{{ note }}

{% endif %}

{% if shipping_address %}

Shipping Details

{{ customer.email }}


Invoice #: _____________________


{% for fulfillment in fulfillments %} Canada Post Tracking #: {{ fulfillment.tracking_number }}
{% endfor %}

{{ shipping_address.name }}
{% if shipping_address.company %} {{ shipping_address.company }}
{% endif %} {{ shipping_address.phone }}
{{ shipping_address.street }}
{{ shipping_address.city }} {{ shipping_address.province_code }} {{ shipping_address.zip | upcase }}
{{ shipping_address.country }}

{% for fulfillment in fulfillments %} Fulfillment Date: {{ fulfillment.created_at| date: "%m/%d/%Y" }} {% endfor %}
{% endif %}

When an automatic discount is applied, it shows the discount $, but I also NEED THE DISCOUNT TITLE/CODE TO SHOW:

This is why we build Pixi Order Printer

Pixi will let you write a graphql query for an order so you can use this query to fetch any details connecting from the orders.
There is developement involved, So feel free to contact us through the live chat in the app to help your specific use case.