Retail hardware, software, and Shopify Point of Sale
Hi there,
How would I be able to display my barcode number on the packing slip instead of my SKU?
Thanks.
Tao's
Solved! Go to the solution
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:
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.
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:
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.
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!
To learn more visit the Shopify Help Center or the Community Blog.
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 %}
<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
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 %}
<div class="flex-line-item">
<div class="flex-line-item-img">
{% if line_item.image != blank %}
<div class="aspect-ratio aspect-ratio-square" style="width: {{ desired_image_size }}px; height: {{ desired_image_size }}px;">
{{ line_item.image | img_url: effective_image_dimensions | img_tag: '', 'aspect-ratio__content' }}
</div>
{% endif %}
</div>
<div class="flex-line-item-description">
<p>
<span class="line-item-description-line">
{{ line_item.title }}
</span>
{% if line_item.variant_title != blank %}
<span class="line-item-description-line">
{{ line_item.variant_title }}
</span>
{% endif %}
{% if line_item.sku != blank %}
<span class="line-item-description-line">
SKU: {{ line_item.sku }}
</span>
{% for item in order.line_items %}
{% if item.sku == line_item.sku %}
<span class="line-item-description-line">
Barcode: {{ item.variant.barcode }}
</span>
{% break %}
{% endif %}
{% endfor %}
{% endif %}
{% for group in line_item.groups %}
<span class="line-item-description-line">
Part of: {{ group.title }}
</span>
{% endfor %}
</p>
</div>
<div class="flex-line-item-quantity">
<p class="text-align-right">
{{ line_item.shipping_quantity }} of {{ line_item.quantity }}
</p>
</div>
</div>
{% endfor %}
Then I added this code to my Draft Invoice Liquid Template:
{% for line in subtotal_line_items %}
<tr class="order-list__item">
<td class="order-list__item__cell">
<table>
<td class="order-list__image-cell">
{% if line.image %}
<img src="{{ line | img_url: 'compact_cropped' }}" align="left" width="60" height="60" class="order-list__product-image"/>
{% else %}
<div class="order-list__no-image-cell">
<img src="{{ 'notifications/no-image.png' | shopify_asset_url }}" align="left" width="60" height="60" class="order-list__no-product-image"/>
</div>
{% endif %}
</td>
<td class="order-list__product-description-cell">
{% if line.product.title %}
{% assign line_title = line.product.title %}
{% else %}
{% assign line_title = line.title %}
{% endif %}
<span class="order-list__item-title">{{ line_title }} × {{ line.quantity }}</span><br/>
{% if line.variant.title != 'Default Title' %}
<span class="order-list__item-variant">{{ line.variant.title }}</span><br/>
{% endif %}
{% if line.sku != blank %}
<span class="order-list__item-sku">SKU: {{ line.sku }}</span><br/>
{% for item in order.line_items %}
{% if item.sku == line.sku %}
<span class="order-list__item-barcode">Barcode: {{ item.variant.barcode }}</span><br/>
{% break %}
{% endif %}
{% endfor %}
{% endif %}
{% for group in line.groups %}
<span class="order-list__item-variant">Part of: {{ group.display_title }}</span><br/>
{% endfor %}
</td>
<td class="order-list__price-cell">
{% if line.original_line_price != line.final_line_price %}
<del class="order-list__item-original-price">{{ line.original_line_price | money }}</del>
{% endif %}
<p class="order-list__item-price">
{% if line.final_line_price > 0 %}
{{ line.final_line_price | money }}
{% else %}
Free
{% endif %}
</p>
</td>
</table>
</td>
</tr>
{% endfor %}
This last solution worked for me! Thank you for sharing!
By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024Thanks to everyone who participated in our AMA with 2H Media: Marketing Your Shopify St...
By Jacqui Sep 6, 2024