Feedback for your online store from the community
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
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!
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?
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?
Please continue. Do we have to use Javascript? Is Liquid not possible to execute this task?
First add sku to product pages you can find Shopify help by searching
Use the code in In the Sections directory, click product.liquid or product-template.liquid
{% assign current_variant = product.selected_or_first_available_variant %} <span class="variant-sku">{{ current_variant.sku }}</span>
SAVE
This is a quick fix to have barcode numbers show up...it worked for me. Edit your SKU's to not just the SKU but SKU plus UPC as attached.
User | RANK |
---|---|
27 | |
22 | |
9 | |
8 | |
5 |
Thanks to all Community members that participated in our inaugural 2 week AMA on the new E...
By Jacqui Mar 10, 2023Upskill and stand out with the new Shopify Foundations Certification program
By SarahF_Shopify Mar 6, 2023One of the key components to running a successful online business is having clear and co...
By Ollie Mar 6, 2023