Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
We're having an issue with Order Printer where refunded line items are appear on the packing slip. This is confusing to our packers and customers. The native packing slip, available under shipping settings, does not have this issue because it has access to the variable:
{% for line_item in line_items_in_shipment %}
However, when I attempt to include a forloop calling line_items_in_shipment in my Order Printer packing slip template, it returns null. Am I missing something here? What I can I do to call only those items in the shipment? Here's an example:
<div style="margin: 0 0 1.5em 0; padding: 1.5em; border: 1px solid black;">
<h2 style="margin: 0 0 1em 0;">Sender</h2>
<strong>{{ shop.name }}</strong><br/>
{{ shop.address }}<br/>
{{ shop.city }} {{ shop.province_code }} {{ shop.zip | upcase }}<br/>
{{ shop.country }}
</div>
{% if shipping_address %}
<div style="margin: 0 0 1.5em 0; padding: 1.5em; border: 1px solid black;">
<h2 style="margin: 0 0 1em 0;">Recipient</h2>
<strong>{{ shipping_address.name }}</strong><br/>
{{ shipping_address | format_address }}<br/>
{{ shipping_method.title }}
</div>
{% endif %}
<table class="table-tabular" style="margin: 0 0 1.5em 0;">
<thead>
<tr>
<th>Quantity</th>
<th>Item</th>
</tr>
</thead>
<tbody>
{% for line_item in line_items_in_shipment %}
<tr>
<td>{{ line_item.shipping_quantity }} x</td>
<td><b>{{ line_item.title }}</b></td>
{% endfor %}
</tbody>
</table>
Did you end up solving this @Riotact ? I'm running into the same issue.
Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025Discover opportunities to improve SEO with new guidance available from Shopify’s growth...
By Jacqui May 1, 2025