Order printer template and shopify automatic discount

Topic summary

Issue: Automatic discounts in Shopify were not appearing on invoices generated by Order Printer/Order Printer Templates, though manual codes and app-based discounts did.

Cause/Context: Templates were set to show discount codes or line-item discounts, but Shopify’s automatic discounts weren’t picked up by those fields.

Solution (community-confirmed): Update the template to reference the aggregate discount amount and conditionally render it.

  • Add a conditional before the subtotal: if total_discounts > 0, display {{ total_discounts | money }}.
  • Example: place the discount block above the Subtotal section so it always renders when a discount exists.

Optional enhancement: For non-automatic discounts, loop through discounts to display names/codes alongside the total:

  • Example: {% for discount in discounts %}“{{ discount.code }}”{% endfor %} with {{ total_discounts | money }}.

Outcome: Multiple users confirmed the fix displays automatic percentage-off discounts correctly. No app changes required; only template edits.

Status: Effectively resolved via template modification. Code snippets are central to applying the solution.

Summarized with AI on January 16. AI used: gpt-5.

Hello!

I tried for the first time to use the automatic discount on shopify. It work great but I use order printer and order printer template to print my invoices and the discount do not appear in it.

Is there something i could do to fixe this?

Hi,

You’ll need to modify your template with Order Printer to include the discount applied to the order. This should be one of the merge fields that you can add.

Good luck!

I did try to modify the template, and it’s actually setup to show discount
code, or the discounted item.
It work with manual discount, coupon code, and with an app that I usually
use for sales. But it doesn’t work with the shopify autoomatic discout
option :frowning:

Our’s does not show either. What would be the edit to fix this please?

I believe I figured it out. Moved discount code to the top and altered it that it will show if there is an amount over $0.00

FROM:

{% for discount in discounts %} {% endfor %} {% if shipping_address %} {% endif %} {% if total_paid != total_price %}

TO:

Subtotal price: {{ subtotal_price | money }}
Includes discount "{{ discount.code }}" {{ discount.savings | money }}
Total tax: {{ tax_price | money }}
Shipping: {{ shipping_price | money }}
Total price: {{ total_price | money }}
Total paid: {{ total_paid | money }}
{% comment %} Discount Amounts {% endcomment %} {% if total_discounts > 0 %} {% endif %} {% if shipping_address %} {% endif %} {% if total_paid != total_price %}
Total Discounts: {{ total_discounts | money }}
Subtotal price: {{ subtotal_price | money }}
Total tax: {{ tax_price | money }}
Shipping: {{ shipping_price | money }}
Total price: {{ total_price | money }}
Total paid: {{ total_paid | money }}

I got mine working, add this to the template just above subtotal section.


  {%  if total_discounts > 0 %}
    Discount amount:
    {{ total_discounts | money }}
  {% endif %}
  
2 Likes

Thanks for the solution.

I used this to include the discount name for Non-Automatic discounts.

{% if total_discounts > 0 %}

Total Discounts: {% for discount in discounts %}"{{ discount.code }}"{%endfor%}
    {{ total_discounts | money }}

{% endif %}

Thanks Craig you just solved my problem of displaying the discount for an automatic percentage off sale. :slightly_smiling_face:

Thanks Craig.