Hi there,
How would I be able to display my barcode number on the packing slip instead of my SKU?
Thanks.
Tao’s
Hi there,
How would I be able to display my barcode number on the packing slip instead of my SKU?
Thanks.
Tao’s
Hi, @Taos_Boston !
I’m Miles from the Social Care team at Shopify. You will need to add a certain line item in your packing slip code template in order to display the barcode. You can find the line of code here. This guide will also show you other line items you can add as well. As Shopify is unable to support coding help, I did find a post similar to yours in our forums where a Shopify Partner was able to provide support on this implementation, so I recommend checking that post out. You can find it here.
Are you using our Order Printer app for your packing slips and invoices? If not, I highly recommend it. It’s got some great features including:
We also have a great guide to help you navigate Order Printer which I recommend checking out: https://bit.ly/3nns6Ek.
I’d love to hear more about your store. If you’re looking at increasing traffic to your store, I recommend checking out Shopify Compass. Shopify Compass provides you with webinars and courses on things like store design, marketing and more. It’s 100% free for everyone and new content is being added all the time. This program will help you drive more traffic into your store and also convert that traffic into sales.
Have you heard about the Shopify Blog? It’s got loads of great content on ways for you to drive sales into your store. I’ve got some great recommendations below that I’d recommend taking a look at:
The 39-Point Store Trust Checklist
Thanks!
Hey Miles,
This doesn’t actually work. Barcode isn’t a variable for packing slips for some reason. https://help.shopify.com/en/manual/orders/packing-slips-variable-list
Not sure why it isn’t, but no matter what I do, it will not locate the barcode. Oddly enough, barcode has a variable in the notification variables here - https://help.shopify.com/en/manual/orders/notifications/email-variables#line-item
line.variant.barcode
But not in the packing slip variables, which makes zero sense to me since have a product barcode on a packing slip seems more useful than on notifications. Any help you can give me here would be greatly appreciated.
You also cannot add it to a custom packing slip using Order Printer app. So frustrating.
Hi, @Brodydezember !
Thanks for letting me know. Are you able to try adding the following code to the packing slip template in Order Printer and let me know if this pulls the barcode data?
{{ line_item.variant.barcode }}
As an example, the line of code could read like this:
<tbody>
{% for line_item in line_items %}
<tr>
<td>{{ line_item.quantity }} x</td>
<td>{{ line_item.title }} <b>({{ line_item.sku }})</b>{{ variant.sku }}</td>
<td>{{ line_item.variant.barcode }}</td>
{% if line_item.tax_lines %}
<td>
If after trying this it’s still not working, please let me know and I’ll have a chat with our team to see if we can help you out.
Thanks!
Crazy, I tried something similar last night to this set of code and it didn’t work. This time it did. It’s ugly, but it is at least working. Now, I just need to build it out. I ended up install Order Printer Pro and was able to work with the templates there and add in the barcode and it works and looks good, I just don’t want to pay the $10 a month for it.
Thanks for your help!
Hey @Miles I’ve tried using the updated version of the barcode you recommended {{ line_item.variant.barcode }} as well as the version listed on the notification variables reference documentation {{ line.line_item.variant.barcode }} but I’m unable to get the barcode to pull into my packing slip template.
I notice that there’s no barcode variable available in the packing slip reference documentation.
Is a barcode not supported for packing slips? This would greatly assist with our fulfillment workflow.
Can you advise here? Thanks so much!
agree! Is there no solution for this apart from a paid app?
Hi!
Is there still no way to add the barcode/EAN number to the native packing slip without using an extra app for that?
Thanks!
You can use this workaround to display product barcode on packing slips (without installing any apps). Edit your packing slip template (Settings > Shipping and Delivery > Edit Packing Slip Template) to replace the snippet that displays product SKU
{% if line_item.sku != blank %}
{{ line_item.sku }}
{% endif %}
with the following:
{% if line_item.sku != blank %}
{% for item in order.line_items %}
{% if item.sku == line_item.sku %}
{{ item.variant.barcode }}
{% break %}
{% endif %}
{% endfor %}
{% endif %}
Hope this helps
can you confirm that this is still working? I edited exactly as stated, and it doesn’t appear to be working for our packing slips. anyone else have any luck?
This worked perfectly for me and is still working as of 2/01/2024 dd/mm/yy
Unfortunately doesn’t work for me. When I loop through the order.line_items I can match item.sku == line_item.sku, and get some data out, but not the barcode.
This seems like such a trivial thing for Shopify to fix (just expose line_item.barcode), and 3 years later it hasn’t happened. So frustrating.
Are you sure the you have set the barcode for that particular product variant? If yes, can you show what the variant object looks like by replacing
item.variant.barcode
with
item.variant | json
OK, so I know the solution was technically provided - however, it did not work for me. I figured that if I am finding this thread in my search for a solution that I would share what I did.
WHAT I NEEDED TO DO:
I need my Draft Invoice and Packing Slips to include BOTH SKU and UPC (Barcodes).
I edited the Liquid Template for my Packing slip to Display SKU and Barcode:
Here is the code:
{% for line_item in line_items_in_shipment %}
{{ line_item.title }} {% if line_item.variant_title != blank %} {{ line_item.variant_title }} {% endif %} {% if line_item.sku != blank %} SKU: {{ line_item.sku }} {% for item in order.line_items %} {% if item.sku == line_item.sku %} Barcode: {{ item.variant.barcode }} {% break %} {% endif %} {% endfor %} {% endif %} {% for group in line_item.groups %} Part of: {{ group.title }} {% endfor %}
{{ line_item.shipping_quantity }} of {{ line_item.quantity }}
Then I added this code to my Draft Invoice Liquid Template:
{% for line in subtotal_line_items %}
|
{% if line.image %}
|
{% if line.product.title %}
{% assign line_title = line.product.title %}
{% else %}
{% assign line_title = line.title %}
{% endif %}
{{ line_title }} × {{ line.quantity }} {% if line.variant.title != ‘Default Title’ %} {% if line.sku != blank %} {% for group in line.groups %} |
{% if line.original_line_price != line.final_line_price %}
{% if line.final_line_price > 0 %} {{ line.final_line_price | money }} {% else %} Free {% endif %} |
This last solution worked for me! Thank you for sharing!