Adding Line Item Location to Packing Slip

Hi there,

Does anyone have any idea what variable I would need to add to my packing slips to include the products location beside the name? I mocked up what I’m looking for quickly in photoshop so you get an idea:

Thanks,

Chelsea

Hi ChelseaColgan

Do you still need help with this or did you find a solution?

Hi! No, I never got it sorted!

You need to make an order metafield with the product location information to display it on the order packing slip. You will need Shopify Flow to do this. It is free on the Shopify subscription and Shopify Advance subscription

https://apps.shopify.com/flow

I will number all the steps to keep it easy.

  1. Go to /settings/custom_data/productvariant/metafields

Make the following metafield

variant.metafields.stock.bin (stock is the namespace and bin is the key)

It must be single line text.

  1. Go to /settings/custom_data/order/metafields

Make the following metafield

order.metafields.stock.bin (stock is the namespace and bin is the key)

It must be single line text.

  1. Make the flow to that will create the order metafield

Go to Sfopify Flow. Trigger will be Order Created. Action will be Update Order Metafield.

Then enter the following

Key is bin

Metafield namespace is stock

Value is

{% for lineItems_item in order.lineItems %}{% for metafields_item in lineItems_item.variant.metafields %}{% if metafields_item.key == 'bin' and metafields_item.key != '' %},{{ lineItems_item.sku }}:Bin:{{ metafields_item.value }}{% endif %}{% endfor %}{% endfor %}

Do not make any spaces or new lines in this code or it will not work. Copy and past it as is.

Type is multi line text.

  1. Next you will add the code to your packing slip template.

Go to settings/ shipping and delivery /packing_slip_template, then edit.

Look for this code

{% if line_item.sku != blank %}
          
            {{ line_item.sku }} 
        {% endif %}

and replace it with this

{% if line_item.sku != blank %}
          
            {{ line_item.sku }} 
            {% assign sku_bin_pairs = order.metafields.stock.bin | split: ',' %}
            {% for sku_bin_pair in sku_bin_pairs %}
              {% assign sku_bin_info = sku_bin_pair | split: ':' %}
              {% assign sku_info = sku_bin_info[0] %}
              {% assign bin_info = sku_bin_info[2] %}
              {% if sku_info == line_item.sku %}
                 **| {{ bin_info }}**
              {% endif %}
            {% endfor %}
          
        {% endif %}
  1. Nxt you need to fill in the product locations. Go to each product or product variant and at the bottom you will find the metafields and the bin. Enter your location here. The location that I used did not contain any spaces, like 1A45

This will only work on new orders once the flow created the order metafield with the product location that you entered.

It will look like this on your packing slip

SKU | Location

Let me know if you need help.

If this works for you please accept this as a solution.

How are you getting variant.metafields.stock.bin as fields in the Order Metafield Namespace and key area? I try that and get

“You need to use one period (.) to separate the namespace and key”

And am stuck with stock.bin which creates order.metafields.stock.bin

would something like this work for adding “final sale” to a line item that is part of a specific tag or collection?

@DAW01 Hi,

The step #3:

“type is multi line text.”

→ It gives an error when adding multi-line text (because the metafields are single-line)

When I changed Flows multi-line to → single line = it works

I can see SKU + shelf location in packing slip:

“EDD-502 | A36”

“EDD-502” Is the product’s SKU & A36 is the location – which I entered on the product page (admin)

I think this doesn’t work if you use other packing slips (3rd party logistic service) than Shopify’s own?

Hi @DAW01 ,

Sorry, bringing this up again after so long! Our issue is actually that each product could be split between 2 locations (i.e. each variant of the product may have stock in both locations), as the two locations are our warehouse and our shop.

Is there a way that the system can read which location the specific item was in at the time of the order, and have that location displayed on the packing slips?

Let me know if you need any additional information, or if I can explain better. Thanks!