Shopify Order Printer App Compatibility

Variant Option Product Options supports the Shopify’s Order Printer app. It’s a free app that quickly prints custom packing slips, invoices, labels, or receipts for all your orders.

Invoice

To display virtual option data in the invoice template follow the steps below.

First, look for this line in the template editor:

{% for p in line_item.properties %}

If you found this line, then your template is all good. You can stop here.

If this line isn’t there, look for the item title:

{{ line_item.product_title }}

Then paste this code after it:

{% for p in 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 %}
<div class="item-description-line">{{ p.first }}: {{ p.last }}</div>
{% endunless %}
{% endfor %}

 

If your product title is inside td tags (<td></td>) make sure to put the code before the ending </td> tag.

Packing Slip

The packing slip doesn’t display a list of items by default, so we’ll add the list of items including the virtual option data.
At the bottom of the packing slip template, add this code:

<h3 style="margin: 2em 0 1em 0;">Item Details</h3>

<table class="table-tabular" style="margin: 0 0 1.5em 0;">
  <thead>
    <tr>
      <th>Quantity</th>
      <th>Item</th>
      {% if show_line_item_taxes %}
      <th>Taxes</th>
      {% endif %}
      <th>Price</th>
    </tr>
  </thead>
  <tbody>
    {% for line_item in line_items %}
      <tr>
        <td>{% unless line_item.title contains " - Selections" %}{{ line_item.quantity }} x{% endunless %}</td>
        <td><b>{{ line_item.title }}</b>

          {% for p in line_item.properties %}
            {% unless p.last == blank or p.first == '_' %}
              <div class="bcpo-property">{{ p.first }}:
                {% if p.last contains '/uploads/' %}
                  <div><img src="{{ p.last }}" style="max-width: 50px; height: auto;"></div>
                {% else %}
                  {{ p.last }}
                {% endif %}
              </div>
            {% endunless %}
          {% endfor %}

        </td>
        {% if show_line_item_taxes %}
        <td>
          {% for tax_line in line_item.tax_lines %}
            {{ tax_line.price | money }} {{ tax_line.title }}<br/>
          {% endfor %}
        </td>
        {% endif %}
        <td>
          {% if line_item.original_price != line_item.price %}
            <s>{{ line_item.original_price | money }}</s>
          {% endif %}
          {{ line_item.price | money }}
        </td>
      </tr>
    {% endfor %}
  </tbody>
</table>
Was this article helpful?
Dislike

Pin It on Pinterest