Solved

Display product barcode number on packing slip

Taos_Boston
Tourist
4 0 3

Hi there,

How would I be able to display my barcode number on the packing slip instead of my SKU?

Thanks.

Tao's

Accepted Solution (1)

Miles
Shopify Staff (Retired)
480 68 156

This is an accepted solution.

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:

  • Preview and print all the documents you need for your orders.
  • Showcase your brand by making customizations in HTML and Liquid.
  • Print packing slips and shipping labels for all your orders.

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:

Driving Traffic but No Sales?
* We give you 13 steps to improve your conversions.
* Who is your target audience, and does your sites look and feel cater to them?
* Is your business trustworthy? (Also see the next recommendation below for more on this)

The 39-Point Store Trust Checklist
* Work through a checklist to make sure your store is trusted by potential customers.
* Look at the "nice to haves" vs "must-haves" in your store.
* Do you have essential information for your customers to view, like policies?

Thanks!

To learn more visit the Shopify Help Center or the Community Blog.

View solution in original post

Replies 12 (12)

Miles
Shopify Staff (Retired)
480 68 156

This is an accepted solution.

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:

  • Preview and print all the documents you need for your orders.
  • Showcase your brand by making customizations in HTML and Liquid.
  • Print packing slips and shipping labels for all your orders.

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:

Driving Traffic but No Sales?
* We give you 13 steps to improve your conversions.
* Who is your target audience, and does your sites look and feel cater to them?
* Is your business trustworthy? (Also see the next recommendation below for more on this)

The 39-Point Store Trust Checklist
* Work through a checklist to make sure your store is trusted by potential customers.
* Look at the "nice to haves" vs "must-haves" in your store.
* Do you have essential information for your customers to view, like policies?

Thanks!

To learn more visit the Shopify Help Center or the Community Blog.

Brodydezember
Tourist
7 0 7

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.

Miles
Shopify Staff (Retired)
480 68 156

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!

To learn more visit the Shopify Help Center or the Community Blog.

Brodydezember
Tourist
7 0 7

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!

ForSNG
Visitor
1 0 3

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!

Hill_Station
Visitor
2 0 2

agree! Is there no solution for this apart from a paid app?

dombur
Visitor
2 0 0

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!

ranjan-purbey
Shopify Partner
11 1 3

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 %}
  <span class="line-item-description-line x">
    {{ line_item.sku }}
  </span>
{% endif %}

 

with the following:

{% if line_item.sku != blank %}
  {% for item in order.line_items %}
    {% if item.sku == line_item.sku %}
      <span class="line-item-description-line x">
        {{ item.variant.barcode }}
      </span>
      {% break %}
    {% endif %}
  {% endfor %}
{% endif %}

 

Hope this helps

subzerogg
Visitor
1 0 0

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?

Shane-404
Tourist
4 0 1

This worked perfectly for me and is still working as of 2/01/2024    dd/mm/yy

Andrew145
Visitor
1 0 0

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.

ranjan-purbey
Shopify Partner
11 1 3

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