Packing Slip Template Custom Attributes

Highlighted
Shopify Partner
9 0 0

Hello,

 

I am trying to customize my packing slip template to include the custom attribute for delivery date.

 

I include a delivery date picker in the shopping cart:

 

 <input class="datepicker" id="date" type="text" name="attributes[Delivery Date]" value="{{ cart.attributes.date }}" placeholder="select date" required>

Which then gets passed to the checkout page like so:

 

<script>
     {% for attribute in order.attributes %}
   Shopify.Checkout.OrderStatus.addContentBox(
     '<h2>Delivery Date</h2>',
     '<p>{{ attribute | last }}</p>'
    )
     {% endfor %}
</script>

It then shows up in ORDERS section for each fulfillment item under ADDITIONAL DETAILS, right under the NOTES section.

 

I also include the delivery date in my notification templates:

{% for attribute in attributes %}
    Delivery Date: {{ attribute | last }}
{% endfor %}

What I can't seem to figure out is how to include the delivery date in the Packing Slip template. If I use the Order Printer App, I can display the delivery date like this:

 

{% for attribute in attributes %}
{{ attribute | first }}: {{ attribute | last }}<br>
{% endfor %}

But I can't use this same code snippet in Shopify's packing slip template itself without using the app. I've tried the above calls and they do not work. Is there a way to do this? It really should be easy to add the same variables to all their templates the same way for ease of use and consistency, but maybe I'm just talking nonsense :)

 

If anyone can help I'd really appreciate it.

 

Thanks!

Mark

0 Likes

Hey Mark,

 

Unfortunately there are not as many variables in the native Shopify Packing Slips feature as there are in Order Printer or Order Printer PRo, so you don't have access to the "cart attributes" of an order.

 

The following help article lists what you can access and display: https://help.shopify.com/en/manual/orders/packing-slips-variable-list

 

Kinds regards,

Bjorn

Bjorn Forsberg | FORSBERG+two | Award-winning Shopify Apps since 2011
0 Likes