Updating Packing Slips for Standard Bundles


When fulfilling orders containing Standard bundles, Shopify's default packing slip template displays all items in a flat list. This guide walks you through editing your Liquid packing slip template so items are clearly grouped under their respective bundle titles on printed slips.

Overview

By modifying two section blocks in your Shopify packing slip code, your template will check each line item's hidden bundle data property. It will then dynamically group child products under a bundle header, making fulfillment easier for your warehouse team.

How to Apply the Code Changes

Before making edits, we recommend saving a copy of your original packing slip template in a separate document as a backup.


1.Open Packing Slip settings in Shopify:Navigating to your template.

  1. Log in to your Shopify admin.
  2. Go to Settings > Shipping and delivery.
  3. Scroll down to the Packing slips section and click Edit next to Packing slip template.

2.Replace the opening loop:First code adjustment.

Locate the following line in your template code:

{% for line_item in line_items_in_shipment %}

Replace that single line with the following snippet:

{% assign bundle_ids_done = '' %}
{% for line_item_group in line_items_in_shipment %}
    {% assign group_bundle_id = '' %}
    {% for property in line_item_group.properties %}
    {% if property.first == '_bundle_data' %}
        {% assign group_bundle_id = property.last | split: '#' | last %}
        {% break %}
    {% endif %}
    {% endfor %}

    {% if group_bundle_id != '' %}
    {% if bundle_ids_done contains group_bundle_id %}
        {% continue %}
    {% endif %}
    {% assign bundle_ids_done = bundle_ids_done | append: '#' | append:  group_bundle_id %}
    Bundle: {{ line_item_group.groups[0].title }} - {{ group_bundle_id }}
    <div style="padding-left: 2rem">
    {% else %}
    <div>
    {% endif %}

    {% for line_item in line_items_in_shipment %}
    {% assign bundle_id = '' %}
    {% for property in line_item.properties %}
        {% if property.first == '_bundle_data' %}
        {% assign bundle_id = property.last | split: '#' | last %}
        {% break %}
        {% endif %}
    {% endfor %}
    {% if bundle_id != group_bundle_id %}
        {% continue %}
    {% endif %}

3.Replace the closing loop:Second code adjustment.

Next, scroll down to find this closing snippet:

    {% endfor %}

{% unless includes_all_line_items_in_order %}

Replace it with this updated closing block:

    {% endfor %}
    
    {% endfor %}

{% unless includes_all_line_items_in_order %}

4.Preview and save:Final validation.

Click Preview at the top right to verify that your changes render properly without liquid syntax errors, then click Save.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us