Solved

Show barcode on product collection page Dawn theme

vip-a
Tourist
7 0 1

Hey, I need you help.

I am using Dawn theme  version 13.0.1
I would like to display product barcode on collection page under the each product title. It could be next to vendor (see attached file)
Link to the site https://vip-a.shop/collections/antoinette

 

Screenshot 2024-03-05 at 02.05.31.jpg

Accepted Solution (1)

AnneLuo
Shopify Partner
174 36 42

This is an accepted solution.

You can try this code by following these steps:

Step 1: Go to Online Store->Theme->Edit code.

Step 2: Find the card-product.liquid file, and add the following code at this location in the file:

 {%- if card_product.variants.size > 0 and card_product.variants[0].barcode != blank -%}
    <p>Barcode: {{ card_product.variants[0].barcode }}</p>
 {%- endif -%}

 

AnneLuo_0-1709608681565.png

 

 

If this is helpful, please Like and Accept the solution.
Want to modify or custom changes on store? Let me help.
- Feel free to contact me on luomingxia@shinetechsoftware.com.

View solution in original post

Replies 4 (4)

AnneLuo
Shopify Partner
174 36 42

This is an accepted solution.

You can try this code by following these steps:

Step 1: Go to Online Store->Theme->Edit code.

Step 2: Find the card-product.liquid file, and add the following code at this location in the file:

 {%- if card_product.variants.size > 0 and card_product.variants[0].barcode != blank -%}
    <p>Barcode: {{ card_product.variants[0].barcode }}</p>
 {%- endif -%}

 

AnneLuo_0-1709608681565.png

 

 

If this is helpful, please Like and Accept the solution.
Want to modify or custom changes on store? Let me help.
- Feel free to contact me on luomingxia@shinetechsoftware.com.
vip-a
Tourist
7 0 1

Thank you it is working!
Could you tell me which file I have to edit to add barcode also in search result page? 
Example link: https://vip-a.shop/search?q=20171&options%5Bprefix%5D=last

Screenshot 2024-03-05 at 10.04.06.png

vip-a
Tourist
7 0 1

Never mind! It is working also there too! 

AnneLuo
Shopify Partner
174 36 42

Yes, great!

If this is helpful, please Like and Accept the solution.
Want to modify or custom changes on store? Let me help.
- Feel free to contact me on luomingxia@shinetechsoftware.com.