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.

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 %}