Order Printer App - Discount amount not being displayed

So I would like the 20% discount to be shown on the order printer invoice I sent to my customers. On my POS sales it crosses out the old amount and displays the discounted price. But on my online sales channel sales it does not. Any ideas on how I can alter the code?

This is my current code…

{{ "now" | date: "%m/%d/%y" }}
Invoice for {{ order_name }}

{{ shop_name }}

{{ shop.address }}
{{ shop.city }} {{ shop.province_code }} {{ shop.zip | upcase }}
{{ shop.country }}

Item Details

{{ discounts_amount }} {% for line_item in line_items %} {% endfor %}
Quantity Item Price
{{ line_item.quantity }} x {{ line_item.title }} {% if line_item.original_price != line_item.price %} {{ line_item.original_price | money }} {% endif %} {{ line_item.price | money }}

Payment Details

{% if discounts_savings != 0 %} {% for discount in discounts %}{{ discount.savings | times: -1 | plus: subtotal_price | money }}{% endfor %} {% else %} {{ subtotal_price | money }} {% endif %} {% if shipping_address %} {% endif %} {% if total_paid != total_price %}

{% endif %}

Subtotal price: {{ subtotal_price | money }}
Total tax: {{ tax_price | money }}
Shipping: {{ shipping_price | money }}
Total price: {{ total_price | money }}
Total paid: {{ total_paid | money }}

{% if note %}

Note

{{ note }}

{% endif %}

{% if shipping_address %}

Shipping Details

{{ shipping_address.name }}
{{ shipping_address | format_address }}
{% endif %}

I’m having the EXACT same problem. Is there no solution yet?

I have the same issue for about 2 months now, it was working fine before.

These are the variables that doesn’t work anymore, there might be a few more:

{{ discount.code }} or {{ discount.title }}

{{ discount.amount }}

{{ discount.savings }}

{{ line_item.original_price | money }}

The screenshots attached is about an automatic (discount code) purchase and one with a manual discount from the admin. When it’s a manual discount on the product the same template works, it shows both the original price and the discounted price. With an automatic discount it only shows the original price.

The “Discount” line above the subtotal normally wouldn’t show up as it “detects” that there is no discount code used, even though there was. On my custom invoice I had to make a fixed discount line with the following code to get it working again, because without this line the invoice is incorrect. The subtotal price does not add up.

——

{% if total_discounts != 0 %}

Discount - {{ total_discounts | money }}

{% endif %}