Trying to add TOTAL line price to an Order Printer Invoice that I am converting to a COMMERCIAL INV

Topic summary

A user is customizing a Shopify Order Printer invoice template to create a commercial invoice that displays both individual item prices and total line prices (e.g., $20 per pack × 4 packs = $80 total).

Initial Problem:
The user successfully added table headers but couldn’t find the correct Liquid variable to display the total price for each line item.

Solution Provided:

  • Use line_item.line_price instead of line_item.final_line_price
  • The Order Printer app uses different Liquid variables than standard Shopify themes
  • For subtotal, use {{ subtotal_price | money }} rather than cart-based variables

Working Code Structure:
The final solution includes a table with columns for Quantity, Item, Price, and Total Price, using {{ line_item.line_price | money_with_currency }} for the line total and proper formatting with money_with_currency filters.

Additional Issues:

  • One user reported the code removed everything when pasted (possibly formatting-related)
  • Another user is experiencing alignment issues with the Item Price column despite using text-align: right styling

The thread remains open with unresolved formatting and alignment questions.

Summarized with AI on November 1. AI used: claude-sonnet-4-5-20250929.

Hello

I a struggling!!

I have managed to work around adding all of the relevant details required for a legal Commercial Invoice except for adding HS CODES which apparently can’t be done and now adding a TOTAL line item cost… I have to show “individual cost” or in my case pack cost AND the total of that line item cost. For example, a pack of 3 costs $20 but they have purchased 4 packs (of 3) so I must show Price $20 and TOTAL PRICE $80 .

I have managed to add the header but no matter what I do I can’t find the right liquid info to add the TOTAL PRICE to each line. This is how the code looks now:

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

And this is how that part of the invoice looks now:

Any help would be greatly appreciated!!!

Thanks!

Nat

1 Like

Hi Natalia,

The property I think you are looking for is line_item.final_line_price.

All of the line_item properties can be found in this doc.

With that in mind here’s what the code should look like:


{% for line_item in line_items %}

{% endfor %}
<table>

<tr>

<th>

Quantity

</th>

<th>

Item

</th>

<th>

Price

</th>

<th>

Total Price

</th>

</tr>

<tr>

<td>

{{ line_item.quantity }} x

</td>

<td>

**{{ line_item.title }}**

</td>

<td>

{% if line_item.original_price != line_item.price %}
~~{{ line_item.original_price | money }}~~
{{ order_currency }}
{{ line_item.price | money }}
{% endif %}
{{ line_item.price | money }}
{{ product.price | money_with_currency }}
{{ order_currency }}

</td>

<td>

{{ line_item.final_line_price | money_with_currency }}

</td>

</tr>
<tr>

	<td colspan="3">

Subtotal

</td>

	<td>

{{ cart.original_total_price | money_with_currency  }}

</td>

</tr>

</table>

I took the liberty of adding the subtotal ;). You can easily remove it if you don’t need it.

Check out the cart docs if you have questions about the cart properties like subtotal, discounts, and total.

2 Likes

Thank you!

I have copied and pasted the code you sent, spaced out, but it is still not
bringing up the total price for the line.

The description provided via the doc. is correct, that is exactly what I
need to show, but I can’t get it to work.

Try line_item.line_price instead. The liquid variables are different for order printer app.

3 Likes

I found this MOST helpful! However, as Natalia mentions below, the line total did not show up. Also subtotal was blank.

I added in the line of code from Lixon_Louis below, and that fixed the line item total.

Using your code above, and with a couple of modifications, my template now looks like this:

{% for line_item in line_items %} {% endfor %}
Quantity Item Price Total Price
{{ line_item.quantity }} x {{ line_item.title }} {% if line_item.original_price != line_item.price %} {{ line_item.original_price | money }} {{ order_currency }} {{ line_item.price | money }} {% endif %} {{ line_item.price | money }} {{ product.price | money_with_currency }} {{ order_currency }} {{ line_item.line_price | money_with_currency }}
Subtotal {{ subtotal_price | money }}

That fixed the line item total. Thank you!

I would like to do the same. I copied and pasted but it removed everything. I read above about op spacing it out. Do I need to do this? I don’t know how.

Hi,

Can you please help me, I cant align the Item Price to its price though Im using this

Item Price

Thanks in advance!