Order Printer Quantity Code Error

Highlighted
New Member
1 0 0

I just changed the code in my main template to remove refunded/removed items from the quantity. However, now, any item that has a quantity of 1, does not show '1' but just a blank. Is anyone able to let me know which line I need to edit? Thanks in advance and here is the code: 

{% assign refunded_items = "" %}
{% for refund in refunds %}
{% for refund_line_item in refund.refund_line_items %}
{% assign refunded_items = refunded_items | append: refund_line_item.line_item_id | append: ':' | append: refund_line_item.quantity | append: ','%}
{% endfor %}
{% endfor %}
{% assign refunded_items_array = refunded_items | split: ',' %}
{% for line_item in line_items %}</td>
{% assign line_item_id = line_item.id | append: '' %}
{% if refunded_items contains line_item_id %}
{% for refunded_item in refunded_items_array %}
{% assign split_refunded_item = refunded_item | split: ':'%}
{% if split_refunded_item.first == line_item_id %}
{% assign non_refunded_quantity = line_item.quantity | minus: split_refunded_item.last %}
{% endif %}
{% endfor %}
{% endif %}
{% if non_refunded_quantity == 0 %}{% continue %}{% endif %}
<tr>
<td>{{ non_refunded_quantity }} x</td>
<td><b>{{ line_item.title }}</b></td>
<td>{{ line_item.sku }} </td>
<td>
{% if line_item.original_price != line_item.price %}
<s>{{ line_item.original_price | money }}</s>
{% endif %}
{{ line_item.price | money }}
</td>
</tr>
{% endfor %}
</tbody>
</table>

Regards,

Nick

0 Likes