Add barcode to the packing slip ( variants metafields )

Goodday everyone,

I have to add the barcode and other info to the default packing slip on Shopify.

refering to this post

I edit the code as following

(line 125,126, 132, 133)

but it shows nothing on the packingslip

our metafields register as below

How could I display these mefields data on the packing slip?

What you could do is @import the Google Font Barcode font. And add font class to the css. Also, there is builtin barcode metafield. By default, it mirrors the sku.

https://fonts.google.com/specimen/Libre+Barcode+128+Text?query=barcode

Hi @Lin_RelationsJP ,

You can try the following code:

line_item.variant.metafields.custom.barcode

Then check the product variant has successfully added metafields, if everything is correct, it will display fine.

Hope it helps!

Hi LiExtension,

Thanks for your reply,

but I already tried the same code at line 133,

and it didn’t work out.

Do you have another solution?

Hi,

thanks for your reply,

but I’m not only adding the barcode but also other info I registered at metafields.

Do you have other suggestions?

Try this:

{{ line_item.variant.metafields.custom.barcode }}

instead of

{{line_item.variant.metafields.custom.barcode}}

The difference between NE code and SKU and Barcode is the space between text and curly brackets.

Dear AlohaAkahai,

I added the space to lines 125, 126, 132, and 133,

but everything stayed the same.

assuming it only read the product’s data and doesn’t read the metafields data.

Do you have other suggestions?

Hi @Lin_RelationsJP ,

Sorry for the confusion, I checked it again and Shopify doesn’t support this. Refer: https://help.shopify.com/en/manual/shipping/setting-up-and-managing-your-shipping/packing-slips-variable-list#line-items-in-shipment-variables

You can try contacting Shopify directly for this. Refer https://help.shopify.com/en/questions#/contact
Hope it helps!

Hi @LitExtension ,

Many thanks for your help!

I will contact Shopify directly.

What @LitExtension actually said that Shopify doesn’t generate barcodes out of the box.

Here is some more info for you, https://community.shopify.com/topic/1332362

@Lin_RelationsJP

Check this out. https://community.shopify.com/topic/1332362

Scroll down and read @basilkhan comment.

hello @AlohaAkahai

Thank you I will have a look this week@

You can also try our order related documents app, you can build a packing slip with drag & drop designer, it has a barcode line item field too, we are working on adding a metafield component for the line items

Order related documents