Order Printer not showing subtotal for all quantities

Hi all,

Hoping someone can help as Shopify Support is not getting back to me.

We have been using Order Printer for a couple of month now and our book keeping has noticed something off.

The subtotal price and total tax is not correct as it is not taking into account the quantity of the product.

Does anyone know how to fix this please?

The following is our code for our invoices:


{{ transaction.date | "%d/%m/%y" }}
Invoice for {{ order_name }}

{{ shop_name }}

{{ 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 show_line_item_taxes %} {% endif %} {% if line_item.tax_lines %} {% endif %} {% endfor %}
Quantity ItemTaxesPrice(No Tax) Price
{{ line_item.quantity }} x {{ line_item.title }} {% for tax_line in line_item.tax_lines %} {{ tax_line.price | money }} {{ tax_line.title }}
{% endfor %}
{% for tax_line in line_item.tax_lines %} {{ line_item.price | minus: tax_line.price | money }}
{%- comment -%} Added by Ryan A at Shopify on October 7 2021 {%- endcomment -%} {% assign subtotal_before_tax = subtotal_before_tax | plus: line_item.price | minus: tax_line.price %} {%- comment -%} End of changes by Ryan A at Shopify {%- endcomment -%} {% 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

{%- comment -%} Modified by Ryan A at Shopify on October 7 2021 {%- endcomment -%} {%- comment -%} End of changes by Ryan A at Shopify {%- endcomment -%} {% for discount in discounts %} {% endfor %} {% if shipping_address %} {% endif %} {% if total_paid != total_price %} {% endif %}
Subtotal price:{{ subtotal_before_tax | money}}
Includes discount "{{ discount.code }}" {{ discount.savings | money }}
Shipping: {{ shipping_price | money }}
Total tax: {{ tax_price | money }}
Total price: {{ total_price | money }}
Total paid: {{ total_paid | money }}
Outstanding Amount: {{ total_price | minus: total_paid | money }}

{% if note %}

Note

{{ note }}

{% endif %}

{% if shipping_address %}

Shipping Details

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

If you have any questions, please send an email to {{ shop.email }}

Hi @TheBeerBarn

Paste below code in Order Printer editor


{{ transaction.date | "%d/%m/%y" }}

Invoice for {{ order_name }}

**{{ shop_name }}**

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

{% endif %}
{% if line_item.tax_lines %}

{% endif %}

{% endfor %}

| Quantity | Item | Taxes | Price(No Tax) | Price |
| - | - | - | - | - |
| {{ line_item.quantity }} x | **{{ line_item.title }}** | <br>{% for tax_line in line_item.tax_lines %}<br>{{ tax_line.price | times: line_item.quantity | money }} {{ tax_line.title }}<br><br>{% endfor %}<br> | <br>{% for tax_line in line_item.tax_lines %}<br>{{ line_item.price | minus: tax_line.price | money }}<br><br>{%- comment -%} Added by Ryan A at Shopify on October 7 2021 {%- endcomment -%}<br>{% assign subtotal_before_tax = subtotal_before_tax | plus: line_item.price | minus: tax_line.price %}<br>{%- comment -%} End of changes by Ryan A at Shopify {%- endcomment -%}<br>{% endfor %}<br> |  {{ 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

{%- comment -%} Modified by Ryan A at Shopify on October 7 2021 {%- endcomment -%}

{%- comment -%} End of changes by Ryan A at Shopify {%- endcomment -%}

{% for discount in discounts %}

{% endfor %}
{% if shipping_address %}

{% endif %}

{% for line_item in line_items %}
{% if show_line_item_taxes %}

{% endif %} 
{% endfor %}

{% if total_paid != total_price %}

{% endif %}
<table>

<tr>

<td>

Subtotal price:

</td>

<td>

{{ subtotal_price | money }}

</td>
<td>

{{ subtotal_before_tax | money}}

</td>
</tr>
<tr>

<td>

Includes discount "{{ discount.code }}"

</td>

<td>

{{ discount.savings | money }}

</td>

</tr>
<tr>

<td>

Shipping:

</td>

<td>

{{ shipping_price | money }}

</td>

</tr>
<tr>

</tr>

<tr>
<td>

Total tax:

</td>
<td>

{% for tax_line in line_item.tax_lines %}
{{ tax_line.price | times: line_item.quantity | money }} {{ tax_line.title }}

{% endfor %}

</td>
</tr>

<tr>

<td>

**Total price:**

</td>

<td>

**{{ total_price | money }}**

</td>

</tr>
<tr>

<td>

**Total paid:**

</td>

<td>

**{{ total_paid | money }}**

</td>

</tr>

<tr>

<td>

**Outstanding Amount:**

</td>

<td>

**{{ total_price | minus: total_paid | money }}**

</td>

</tr>
</table>

{% if note %}
### Note

{{ note }}

{% endif %}

{% if shipping_address %}
### Shipping Details

**{{ shipping_address.name }}**

{{ shipping_address | format_address }}

{% endif %}

If you have any questions, please send an email to {{ shop.email }}

Hi there,

Thank you for you help.

I have managed to put your edits into action with some additions on my end but I am still struggling with the subtotal…

Its great that the subtotal price is showing the price for the quantity of products but I need the subtotal price to be the Price(no tax). Is there anything you can suggest for this please?

Many thanks!

Hi @TheBeerBarn

Identify below line

{{ tax_line.price | times: line_item.quantity | money }} {{ tax_line.title }}

replace with

{{ tax_line.price | money }} {{ tax_line.title }}