Show itemized bundles items on Simple Bundles 2.0 using Shopify packing slips

To itemize parent bundles and their child contents on your Shopify packing slips, follow the steps below.

Prerequisites

Before you get started, make sure you have all settings configured correctly

  • Ensure you are currently using the Simple Bundles 2.0 version.
  • Enable bundle content line item attributes in your orders. Reach out to the support team to enable this feature, if you don't have it enabled by default.

Editing your packing slip liquid template

  1. Navigate to the Settings > Shipping and delivery > Edit packing slip template. Alternatively, you can navigate to this link to edit the packing slip: https://admin.shopify.com/settings/packing_slip_template
  2. If you are using the default template in the packing slip, locate the {% for line_item in line_items_in_shipment %} line. This line is referenced in steps 3 and 4.
  3. Add the following lines below the located line in step 2:
{% assign is_bundle_item = false %}
{% for property in line_item.properties %}
  {% if property.first == '_sb_bundle_group' %}
    {% assign is_bundle_item = true %}
    {% break %}
  {% endif %}
{% endfor %}

{% if is_bundle_item %}
  {% continue %}
{% endif %}
  1. Add the following lines above the line, located in step 2.
{% comment %}
Gather all unique bundle groups and their details
{% endcomment %}
{% assign bundle_groups = '' %}
{% for line_item in line_items_in_shipment %}
  {% assign group_id = '' %}
  {% assign group_title = '' %}
  {% assign group_quantity = '' %}
  {% for property in line_item.properties %}
    {% if property.first == '_sb_bundle_group' %}
      {% assign group_id = property.last | split: ' ' | first %}
    {% endif %}
    {% if property.first == '_sb_bundle_title' %}
      {% assign group_title = property.last %}
    {% endif %}
    {% if property.first == '_sb_bundle_variant_id_qty' %}
      {% assign group_quantity = property.last | split: ':' | last %}
    {% endif %}
  {% endfor %}
  {% if group_id != '' and group_title != '' and group_quantity != '' %}
    {% assign group_info = group_id | append: '::' | append: group_title | append: '::' | append: group_quantity %}
    {% unless bundle_groups contains group_info %}
      {% assign bundle_groups = bundle_groups | append: group_info | append: '||' %}
    {% endunless %}
  {% endif %}
{% endfor %}

{% comment %}
List all bundle groups
{% endcomment %}
{% assign groups = bundle_groups | split: '||' %}
{% for group in groups %}
  {% assign group_parts = group | split: '::' %}
  {% if group_parts.size == 3 %}
    <div class="flex-line-item">
      <div class="flex-line-item-img">
        <div class="aspect-ratio aspect-ratio-square" style="width: {{ desired_image_size }}px; height: {{ desired_image_size }}px;">
          {{ 'https://cdn.shopify.com/s/files/1/0721/4494/5450/files/image_2.png' | img_tag: '', 'aspect-ratio__content placeholder' }}
        </div>
      </div>
      <div class="flex-line-item-description">
        <p>
          {% assign group_title = group_parts[1] | split: ' | ' %}
          <span class="line-item-description-line">
            BUNDLE: {{ group_title[0] }}
          </span>
          <span class="line-item-description-line">
            {{ group_title[1] }}
          </span>
        </p>
      </div>
      <div class="flex-line-item-quantity">
        <p class="text-align-right">
          {{ group_parts[2] }}
        </p>
      </div>
    </div>

    {% for line_item in line_items_in_shipment %}
      {% assign is_in_current_group = false %}
      {% for property in line_item.properties %}
        {% if property.first == '_sb_bundle_group' %}
          {% assign current_line_item_group_id = property.last | split: ' ' | first %}
          {% if current_line_item_group_id == group_parts[0] %}
            {% assign is_in_current_group = true %}
            {% break %}
          {% endif %}
        {% endif %}
      {% endfor %}

      {% if is_in_current_group %}
        <div class="flex-line-item">
          <div class="flex-line-item-img" style="margin-left: 45px;">
            {% if line_item.image != blank %}
              <div class="aspect-ratio aspect-ratio-square" style="width: {{ desired_image_size }}px; height: {{ desired_image_size }}px;">
                {{ line_item.image | img_url: effective_image_dimensions | img_tag: '', 'aspect-ratio__content' }}
              </div>
            {% endif %}
          </div>
          <div class="flex-line-item-description">
            <p>
              <span class="line-item-description-line">
                {{ line_item.title }}
              </span>
              {% if line_item.variant_title != blank %}
                <span class="line-item-description-line">
                  {{ line_item.variant_title }}
                </span>
              {% endif %}
              {% if line_item.sku != blank %}
                <span class="line-item-description-line">
                  {{ line_item.sku }}
                </span>
              {% endif %}
              {% for group in line_item.groups %}
                <span class="line-item-description-line">
                  Part of: {{ group.title }}
                </span>
              {% endfor %}
            </p>
          </div>
          <div class="flex-line-item-quantity">
            <p class="text-align-right">
              {{ line_item.shipping_quantity }} of {{ line_item.quantity }}
            </p>
          </div>
        </div>
      {% endif %}
    {% endfor %}
  {% endif %}
{% endfor %}
  1. Navigate to one of your bundle orders that has the line item attributes enabled and click on "Print packing slips"

  1. Now you should be able to see the bundles itemized with their contents and the non-bundles listed right after.
Itemized bundles with contents along with non-bundle products

Itemizing your packing slips can simplify your shipping and packing process as the bundles and their items are easily grouped together, making it easier for your team to read and scan over the default packing slip template shown below:

Default packing slip without the packing slip edits

To view the entire packing slip template, view the file here: https://gist.github.com/basilkhan05/74791a4eeb4ecf0ef19e59dc22a44e5c. You can also view the line-by-line revisions to the default template as shown here: https://gist.github.com/basilkhan05/74791a4eeb4ecf0ef19e59dc22a44e5c/revisions.


If you would like assistance with your packing slip templates, reach out to our technical support team.

Still need help? Contact Us Contact Us