I canât give you the code but I can tell your steps.
Add tag new or best-seller for products that you want to show badge, go to your product list liquid file, add code to check if product contain those tags, add custom HTML badge and then you need to add customize CSS code to make badge appear in place that you want.
I then loop through this JSON metafield from the âcard-product.liquidâ file:
{% assign label_data = card_product.metafields.custom.labels %}
{% for label in label_data.value %}
{{ label['TEXT_VALUE'] }}
{% endfor %}
This way I can dynamically add, change and remove badges from my products. I can even manage the badgeâs background-color, text-color and text alll from the product view.
Go to Online Store > click on Themes > click the three dots to the left of Customize > Edit Default Theme Content
Under Products, look for âOn saleâ and enter the label youâd like to appear.
Note: this will apply the same label to every item thatâs on sale. If you want to apply unique labels, youâd want to edit the product image so that the label appears on the image or youâll need to find an app.