Use Order Printer to print only line_items_in_shipment

Topic summary

A user is experiencing an issue where refunded line items appear on packing slips generated through Order Printer, causing confusion for warehouse staff and customers.

The Problem:

  • Shopify’s native packing slip (under shipping settings) correctly filters items using the line_items_in_shipment variable
  • When attempting to use this same variable in Order Printer templates, it returns null/no data

What They’re Trying:
The user provided template code showing their attempt to loop through line_items_in_shipment to display only items actually being shipped (excluding refunded items).

Current Status:

  • The issue remains unresolved
  • A second user has encountered the identical problem and is seeking confirmation if a solution was found
  • No working solution or explanation has been provided yet

Core Question: How can Order Printer templates access the line_items_in_shipment variable to exclude refunded items from packing slips?

Summarized with AI on November 4. AI used: claude-sonnet-4-5-20250929.

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:


  ## Sender
  **{{ shop.name }}**

  {{ shop.address }}

  {{ shop.city }} {{ shop.province_code }} {{ shop.zip | upcase }}

  {{ shop.country }}

{% if shipping_address %}

  ## Recipient
  **{{ shipping_address.name }}**

  {{ shipping_address | format_address }}

  {{ shipping_method.title }}

{% endif %}

    {% for line_item in line_items_in_shipment %}
      
    {% endfor %}
  

| Quantity | Item |
| - | - |
| {{ line_item.shipping_quantity }} x | **{{ line_item.title }}** |

1 Like

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