How can I add a new arrivals badge to products using code?

Can anyone help me that how we can add the badge of new arrivals in the products with the help of codes

1 Like

@Wasif3

Thanks for post

add this code to your product cart grid, a product grid item product item depend on your theme “new” add this tag to your prodcut

{%- assign productTags = product.tags | join: ',' -%}
{%- if product.tags contains "new" -%}

New

{%- endfor -%}
{%- endif -%}

when i added this code an error has been occured. and in minimal theme their is no product card.grid

can you please help me what should i do?

@Wasif3

i have update code can you please check

Thanks

@KetanKumar

can you please clearly define that where should i have to paste the code because their is no product.card.grid file in my theme. I am adding this code in product.grid.item

can you please tell me either this code is add at the bottom or top of the product.grid.item file. I am using minimal theme

@Wasif3

I need your store login details. Yes, I know your login details are confidential. For this second option, I have added your store to my Shopify partner account so I will check your code easily and manage what you think about it?

@KetanKumar

yeah sure

store url:pakistantiedye.myshopify.com

password:Student2951

@KetanKumar

yes please check it from your side because i have added codes so many times but the problem is still there

@Wasif3

i mean store admin

If you want your products to be automatically tagged with any tag defining a “new arrival” try using the New Arrivals app. It can automatically tag and untag products based on creation or publishing date. You can set up a concrete period of time the products should be considered to be “new”. Although you would still need to make a front-end theme adjustment to show the badge, the app will help you avoid manually keeping track of those products i.e. it will automatically remove the tag after a specified period of time. It might be helpful to those merchants who have huge products rotation.

Hi @Wasif3 ,

Please refer the below video to achieve the same.

Hope this will help