Use Order Printer Pro packing slips and invoices to show itemized bundle items

Indent bundle items under the bundle in your order printer pro packing slips and receipts

1. Navigate to the Order Printer Pro app and click on Manage templates tab.

2. Select the template you would like to modify and click on "Edit template". In this example, we will be using the packing slip templates.

3. Scroll down to the section where the line item for loop begins. You can also search for:

for line_item in line_items<br>

Add this line right before the for loop:

{% assign discount_application_titles = discount_applications | map: 'title' %}

Add this code snippet after the for loop:

{% assign line_item_is_bundle_item = false %}
{% for discount_allocation in line_item.discount_allocations %}
  {% if discount_application_titles[discount_allocation.discount_application_index] contains "Simple Bundles: " %}
    {% assign line_item_is_bundle_item = true %}
    {% continue %}
  {% endif %}
{% endfor %}
{% if line_item_is_bundle_item %}
  {% continue %}
{% endif %}

4. Scroll down to the page section with the following section.

Right before this section, add the following code snippet:

<!-- BUNDLE items for each line item -->
{% if line_item.variant_title == blank %}
{% assign line_item_title = line_item.product_title  %}
{% else %}
{% assign line_item_title = line_item.product_title | append: " - " | append: line_item.variant_title %}
{% endif %}
{% for bundle_item_line_item in line_items %}
{% assign bundle_item = false %}
{% for discount_allocation in bundle_item_line_item.discount_allocations %}
  {% assign bundle_title = discount_application_titles[discount_allocation.discount_application_index] | split: " | ID: " | first | remove: "Simple Bundles: " | remove: "<br>" %}
  {% if bundle_title == line_item_title %}
    {% assign bundle_item = true %}
    {% continue %}
  {% endif %}
{% endfor %}
{% unless bundle_item %}
  {% continue %}
{% endunless %}

{% if bundle_item_line_item.fulfillment_quantity < 1 %}{% continue %}{% endif %}
<div class="order-table-row order-table-body" style="padding-left: 58px">
  {% if SETTING_show_product_images == true %}
    <div class="order-table-cell item-image">
      <div class="aspect-ratio aspect-ratio-square" style="width: {{ SETTING_product_image_size }}px; height: {{ SETTING_product_image_size }}px;">
        {% if bundle_item_line_item.image != blank %}
          {{ bundle_item_line_item.image | img_url: effective_image_dimensions | img_tag: '', 'aspect-ratio__content' }}
        {% else %}
          {{ '/product_image_placeholder.svg' | img_tag: '', 'aspect-ratio__content placeholder' }}
        {% endif %}
      </div>
    </div>
  {% endif %}
  <div class="order-table-cell item-description">
    <p>
      <span class="item-description-line">
        {{ bundle_item_line_item.product_title }}
      </span>
      {% if bundle_item_line_item.variant_title != blank %}
        <span class="item-description-line">
          {{ bundle_item_line_item.variant_title }}
        </span>
      {% endif %}
      {% if bundle_item_line_item.sku != blank %}
        <span class="item-description-line">
          {{ TEXT_sku }}{{ bundle_item_line_item.sku }}
        </span>
      {% endif %}
      {% for p in bundle_item_line_item.properties %}
                {% assign p_internal = p.first | slice: 0 %}
                {% unless p.first contains "builder_id" or p.first contains "builder_info" or p.first contains "master_builder" or p_internal == "_" or p.last == "" or p.last == blank %}
                  {% if p.last contains "/uploads/" or p.last contains "cdn.shopify.com" %}
                    <span class="item-description-line"><a href="{{ p.last }}" target="_blank">{{ p.first }}</a></span>
                  {% else %}
                    <span class="item-description-line">{{ p.first }}: {{ p.last }}</span>
                  {% endif %}
                {% endunless %}
              {% endfor %}

      {% if SETTING_show_product_barcodes == true and bundle_item_line_item.variant.barcode != blank %}
        <img class="barcode" data-barcode="{{ bundle_item_line_item.variant.barcode }}">
      {% endif %}
    </p>
  </div>
  <div class="order-table-cell item-quantity text-align-right">
    {{ bundle_item_line_item.fulfillment_quantity }} {{ TEXT_qty_of }} {{ bundle_item_line_item.quantity | minus: bundle_item_line_item.refunded_quantity }}
  </div>
</div>
{% endfor %}

All of these revisions have been summarized in the Github Gist: https://gist.github.com/basilkhan05/3cfd26ba4d58e8c1f88517d94f2f6509/revisions

If you would like to view the entire packing slip template, view this Github Gist file.

5. Once updated, your packing slip should indent the bundle items right under the bundle:

If you are interested in the Order Printer Pro invoice template, you can view this gist here: https://gist.github.com/basilkhan05/8084f2f95e02e66bcd1710a70ba6bf86

📝  If you have the same bundle as a separate line items in the same order (as a result of post-purchase upsells), this current template is not currently compatible.

If you have any questions regarding Order Printer Pro templates, reach out to our team over chat or email.

Still need help? Contact Us Contact Us