FROM CACHE - en_header

Add Barcode to Product Page

lauralonno
New Member
1 0 0

Hi! 

This is my first post and I'm hoping someone can help. I'm looking to add product barcodes (not SKU) to my product page so they're visible for a wholesale buyer needs them to be visible for ease.

I have 6 variants on my products, the barcodes are EAN13 and use the 'District' theme.

I seem to be able to find a lot of references to adding SKUs, but none seem to work for me.

Any help would be greatly appreciated!

Thanks

Replies 5 (5)
JHKCreate
Shopify Partner
3467 624 879

Hi @lauralonno 

To access the product variant's barcode you would need the following code:

{% for variant in product.variants %}
{{ variant.barcode }}
{% endfor %}


However, keep in mind that variant.barcode will display multiple barcodes here, and since you have variants, you would need to setup some JavaScript depending on your theme to track that variant change and change the barcode as well.

Let me know if this helps!

Did we solve your issue? Like & Mark As Solution to help the community
Should you need any direct help: contact@jhkcreate.com

Learn more about us: jhkcreate.com
CicelyHuang
New Member
2 0 0

Hello, my theme template is "District", I want to display the corresponding barcode for different variants instead of all of them, how can I do it?

JHKCreate
Shopify Partner
3467 624 879

Hi @CicelyHuang 

 

You would need custom coding to get this done correctly, more specifically, you would need a JavaScript code to get this done correctly. Do you have any background in coding?

Did we solve your issue? Like & Mark As Solution to help the community
Should you need any direct help: contact@jhkcreate.com

Learn more about us: jhkcreate.com
CicelyHuang
New Member
2 0 0
None
Bayi
Tourist
5 0 0

Please continue. Do we have to use Javascript? Is Liquid not possible to execute this task?