Order Printer App - losing weight with more than 1 product

New Member
1 0 0


I've been using order printer for our non-commercial invoice as well. I've run into a couple of issues, but the main issue is as followed.

Everything is fine as long as i have one product in the order, but as soon i have multiple products, my weight becomes 0.0 kg.

I hope you can help me out. Here is the code i've been using:

<table class="table-tabular" style="margin: 0 0 1em 0;">
{% assign total_weight = 0 %}
{% for line in line_items %}
{% assign total_weight = line.quantity | times: line.grams | plus: total_weight %}
{% endfor %}
<th>Description of Goods</th>
<th>Unit Value</th>
<th>Subtotal Value</th>
<th>Unit Net Weight</th>
<th>Country of Origin</th>
<th>Comm. Code</th>
{% for line_item in line_items %}
<td>{{line_item.quantity }}</td>
<td>{{ subtotal_price | money }}</td>
{% if line_item.original_price != line_item.price %}
<s>{{ line_item.original_price | money }}</s>
{% endif %}
{{ line_item.price | money }}
<td> {{ total_weight | divide: totalProductsOrdered | weight_with_unit }} </td>
<td> CN </td>
<td> HS-CODE </td>
{% endfor %}

I hope someone can help me out