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

NataliaM
New Member
2 0 0

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:

 

<table class="table-tabular" style="margin: 0 0 1.5em 0;">
<thead>
<tr>
<th>Quantity</th>
<th>Item</th>
<th>Price</th>
<th>Total Price</th>
</tr>
</thead>
<tbody>
{% for line_item in line_items %}
<tr>
<td>{{ line_item.quantity }} x</td>
<td><b>{{ line_item.title }}</b></td>
<td>
{% if line_item.original_price != line_item.price %}
<s>{{ line_item.original_price | money }}</s>
{{ order_currency }}
{{ line_item.price | money }}
{% endif %}
{{ line_item.price | money }}
{{ product.price | money_with_currency }}
{{ order_currency }}
</td>
</tr>
{% endfor %}
</tbody>
</table>

 

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

NataliaM_0-1612306622945.png

 

Any help would be greatly appreciated!!!

 

Thanks!

 

Nat

0 Likes

 

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:

<table class="table-tabular" style="margin: 0 0 1.5em 0;">
<thead>
<tr>
<th>Quantity</th>
<th>Item</th>
<th>Price</th>
<th>Total Price</th>
</tr>
</thead>
<tbody>
{% for line_item in line_items %}
<tr>
<td>{{ line_item.quantity }} x</td>
<td><b>{{ line_item.title }}</b></td>
<td>
{% if line_item.original_price != line_item.price %}
<s>{{ line_item.original_price | money }}</s>
{{ 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>
{% endfor %}
<tr>
	<td colspan="3" style="text-align: right;">Subtotal</td>
	<td style="text-align: right;">{{ cart.original_total_price | money_with_currency  }}</td>
</tr>
</tbody>
</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.

 

 

If my response was helpful please Like and Mark As Solution.
0 Likes
NataliaM
New Member
2 0 0
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.


0 Likes
Lixon_Louis
Shopify Partner
1174 34 230

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

Shopify - Google Chrome 2021-02-03 18.01.28.png

Available for hiring. Reach me at lixon@ecommercestudio.in
0 Likes