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:
Any help would be greatly appreciated!!!
Thanks!
Nat
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.
User | Count |
---|---|
23 | |
20 | |
17 | |
16 | |
14 |