Liquid, JavaScript, themes, sales channels
Hi,
Trying to custom META fields to the packing slip (bin location of product in warehouse).
Currently, I'm adding is next to SKU:
<span class="line-item-description-line">
{{ line_item.sku }} | Bin Location: {{ product.metafields.my_fields.bin }}
</span>
Here's how I setup the meta field:
Here's the current result (I'm expecting a bin location to show where the red underlining is):
Am I warm or way off with getting to the result I need?
I am waiting the answer ,I have done the same ,but no result!
@MamounZaterlet me know if you find a way in the meantime. I feel like I've tried everything, but probably missing something incredibly obvious.
still searching for solutions !
I will let you know once I knew
If bin locations on a packing/picking slip are what you need, you could see if this solution works for you on Sheet Master https://apps.shopify.com/sheet-master (currently free).
You can set up custom warehouse bin locations, and generate pick lists in custom formats - happy to help with a free custom setup in case you need it. Video demo: https://www.youtube.com/watch?v=O12azLZcmjo
Are you available to hire for some packing slip customization? I have 2 checkout questions and if possible shipping method id like to add. If they wont let us is there another form with more variables I could change to a packing slip? Pondmegastore@yahoo.com thank you
Hi,
I would need the answer to this as well. Anyone ? 🙂
Thanks !
I have used the same logic... no result. What's the solution?
I'm trying to figure this out now! Desperately need this to work!
Same, can't find a solution. I googled like crazy, nothing works. I want to add a "location" product metafield I created so that I can add it to the Packing slip to each product making it easier to pull the product from my bins and racks.
We are trying to do the same exact thing. We ran into a roadblock after finding that the product object (which should contain the metafields) is not available from within the line_item field within the custom packing slip Liquid.
Have the same problem, just seems impossible 😞
Hi @cotty,
Your code looks good, but since product or variant metafields aren't accessible in the Shopify packing slips, I would recommend using Order metafields. The Freshly app, which is mostly used for lot/batch tracking, can also be used for adding bin locations for each product in the order.
Here's a quick demo I made to show how to add the bin locations for each product on the Shopify packing slip: 🎥 https://www.loom.com/share/a949c18c1b544f579cd8cc2a3de1c442
To summarize:
And you should be all set! You can also use Freshly packing slips to do the same where you wouldn't need to rely on Shopify metafields being up-to-date with the recently updated bin locations. Let me know if you have any other questions or reach out to our team at hello@getfreshly.io. 🙂
Try {{ line_item.product.metafields.my_fields.bin }}
Here is what I use that works:
<span class="line-item-description-line">
{% assign barcode = nil %}
{% for item in order.line_items %}
{% if item.sku == line_item.sku %}
{% assign barcode = item.variant.barcode %}
{% assign notes = item.product.metafields.descriptors.subtitle %}
{% endif %}
{% endfor %}
{% if barcode != blank %}
OTHER: <b>{{ barcode }}</b><br>
{% endif %}
{% if notes != blank %}
NOTES: <b>{{ notes }}</b>
{% endif %}
</span>
any chance you can expand on this solution, I tried your code and was unable to get any of it to work
Certainly.
I use that code in the packing slip template which can be found and edited in the Shipping and delivery settings. If a product on the packing slip has information in its barcode section or in the subtitle section (This is a meta field that we use), it will be displayed on the packing slip. If there is no information in one or either of those sections, it will not be displayed.
Thanks, after fooling around this morning I got it to work, had to make a few changes but got the meta field data to show after getting the correct metafield call working
This worked for me too thanks!
On a 2.0 store, the following works for me:
BIN: <b>{{ line_item.variant.metafields.bin.value }}</b>
Hi,
Do you know why this is not working :
Thank you for your help!
Line item metafield is not available in the packing slip order template. You need to save the line item metafield as an order metafield then use it like this.
but where did you create the metafield? can you explain how you did it? thank you.
Quick and easy
THANK YOU.
I tried to add the new variable to packing slip but is not working.
<span class="line-item-description-line">
{% for item in order.line_items %}
{% if item.sku == line_item.sku %}
{% assign bin_location = item.variant.metafields.custom.location %}
{% endif %}
{% endfor %}
{% if bin_location != blank %}
Warehouse Location: <b>{{ bin_location }}</b>
{% endif %}
</span>
I DID WORK ONLY FOR ONE ITEM, WHY IS NOT SHOWING THE OTHERS IF I ADD SOME INFO TOO?
This is the only way I got it to work
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
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.
2. 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.
3. 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 %}
Type is multi line text.
4. 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 %} <span class="line-item-description-line"> {{ line_item.sku }} {% endif %}
{% if line_item.sku != blank %} <span class="line-item-description-line"> {{ 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 %} <strong> | {{ bin_info }}</strong> {% endif %} {% endfor %} </span> {% endif %}
5. Next 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 or if it worked for you
Its not working for me. I am getting this error in the Flow -
I tried and double-checked but it didn't work for me.
It seems like you included in the loop, so should be ok:
{% for line_item in line_items_in_shipment %}
One item to note if bin_location is empty in the metafields it doesn't print Warehouse Location: either. This plain text can be placed above {% if bin_location != blank %}
ps. this worked without any 3rd party apps as I tried on my own site.
Thank you for your reply. And one more question. Why this variable is not shown in CSV when I export.
I'm not sure of why, but you are correct it isn't available on any of the Shopify exports. I have been using the Matrixify App (https://apps.shopify.com/excel-export-import) to report and import Metafileds and general data.
WOW Matrixify is really good! I will take a closer look to this app. Tnx.
Hello @makiomilano and @paul127
You sure can bulk manage Metafields with Matrixify app.
I understand that you already found the solution, but just in case anybody else stumbles on this thread - here you can find our tutorial on how to manage Shopify Metafields with the Matrixify app.
My solution is for the Shopify Order Printer App. The full packing slip tempale I use is:
<p style="float: right; text-align: right; margin: 0;">
{{ date | date: "%m/%d/%y" }} - {{ shipping_method.title }}<br /><br>
<span style="font-size:72px; font-family: 'Libre Barcode 39 Extended Text', cursive;">*{{ order_number }}*</span><br>
</p>
<div style="float: left; margin: 0 0 1.5em 0;" >
<img src="logo_color.jpg" style="width: 250px; height: 49px;"><br /><br />
{{ shop.address }}<br/>
{{ shop.city }} {{ shop.province_code }} {{ shop.zip | upcase }}<br/>
{{ shop.country }}
</div>
<hr />
<h3 style="margin: 0 0 1em 0;">Item Details</h3>
<table class="table-tabular" style="margin: 0 0 1.5em 0;">
<thead>
<tr>
<th>BIN</th>
<th>Quantity</th>
<th>Item</th>
<th>SKU</th>
</tr>
</thead>
<tbody>
{% assign lineitems = unfulfilled_line_items | sort: "title" %}
{% for line_item in lineitems %}
{% if line_item.fulfillable_quantity > 0 %}
<tr>
<td><b>{{ line_item.variant.metafields.bin.value }}</b></td>
<td><center>{{ line_item.quantity }}</center></td>
<td>{{ line_item.sku }}</td>
<td><b>{{ line_item.title }}</b><br>
<br> </td>
</tr>
{% else %}
{% endif %}
{% endfor %}
</tbody>
</table>
{% for line_item in unfulfilled_line_items %}
{% for p in line_item.properties %}
{% assign hidden_property = p.first | first | replace: '_', true %}
{% unless p.last == blank %}
{% if hidden_property == 'true' %}
{% else %}
{{ p.first }}:
{% if p.last contains '/uploads/' or p.last contains '/assets/' or p.last contains '/products/' %}<img style="width:450px;height:auto" src="{{ p.last }}"/>{% else %}{{ p.last | newline_to_br }}
{% endif %}
{% endif %}
{% endunless %}
<br>
{% endfor %}<br>
{% endfor %}
{% if note %}
<h3 style="margin: 0 0 1em 0;">Note</h3>
<p>{{ note }}</p>
{% endif %}
{% if shipping_address %}
<h3 style="margin: 0 0 1em 0;">Shipping Details</h3>
<div style="margin: 0 0 1em 0; padding: 1em; border: 1px solid black;">
<strong>{{ shipping_address.name }}</strong><br/>
{{ shipping_address | format_address }}
</div>
{% endif %}
<p>If you have any questions, please send an email to <u>{{ shop.email }}</u></p>
<style>
@import url('https://fonts.googleapis.com/css2?family=Libre+Barcode+39+Extended+Text&display=swap');
</style>
Hi, You can use this code for metafield value in Packing slips. I tried it in my code and it's working.
{% for line_item in order.line_items %}
{% assign product = line_item.product %}
{% assign metafield_value = product.metafields.custom.article_number %}
Metafield Value: {{ metafield_value }}
{% endfor %}
Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024Digital marketers and app developers have tracked activity in apps and websites for yea...
By Ollie Mar 13, 2024February was an exciting month with Shopify Editions, informative webinars, and more! F...
By JasonH Mar 7, 2024