Add a custom badge to individual product images (Dawn Theme) based on tag or variant title

Hello, I have products that change titles every year (diaries) And sometimes I sell both current year (2022) and next year (2023) as variants of the same product (to save having to do redirects and image changes each year)

see example here. https://butlerdiaries.com/products/childcare-centre-diary?variant=42970275578092

Can I add some code to put a year badge on the generic images based on the variant title? eg if the variant title contains 2023, overlay variant image with 2023 badge (to save confusion as people do not always tend to read product variant titles)
Thanks in advance!

1 Like

Hi @LennyB , I have try to make something of what you want.

here is an test product that I made.

https://cameras-for-every-location.myshopify.com/products/test-the-childcare-centre-diary

password: anc

1 Like

Hi @LennyB ,

You will need to add some CSS and liquid code for this to make it changeable by variant. You will need a developer to do so.

1 Like