Order Printer App - losing weight with more than 1 product

Highlighted
New Member
1 0 0

Hi,

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>
<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 %}
<thead>
<tr>
<th>Description of Goods</th>
<th>Quantity</th>
<th>Unit Value</th>
<th>Subtotal Value</th>
<th>Unit Net Weight</th>
<th>Country of Origin</th>
<th>Comm. Code</th>
</tr>
</thead>
<tbody>
{% for line_item in line_items %}
<tr>
<td>ITEM</td>
<td>{{line_item.quantity }}</td>
<td>{{ subtotal_price | money }}</td>
<td>
{% if line_item.original_price != line_item.price %}
<s>{{ line_item.original_price | money }}</s>
{% endif %}
{{ line_item.price | money }}
</td>
<td> {{ total_weight | divide: totalProductsOrdered | weight_with_unit }} </td>
<td> CN </td>
<td> HS-CODE </td>
</tr>
{% endfor %}
</tbody>
</table>

I hope someone can help me out

0 Likes