Use Order Printer to print only line_items_in_shipment

Use Order Printer to print only line_items_in_shipment

Riotact
Visitor
2 0 1

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>
Reply 1 (1)

lindahlcorp
Shopify Partner
9 0 2

Did you end up solving this @Riotact ? I'm running into the same issue.

Freelance Shopify Developer & Ecommerce Operator