Product Tag Badges

SHOPIFY SNIPPET
NEW
BESTSELLER

1 Overview

Create automatic product badges based on Shopify tags. This snippet displays professional "NEW" and "BESTSELLER" badges when corresponding tags are detected, helping highlight special products and increase conversions through visual cues.

2 Key Features

Tag-Based Automation

Badges appear automatically when 'new' or 'bestseller' tags are added

Visual Impact

Eye-catching badges that highlight special products effectively

Easy Customization

Modify colors, text, or add more tag types in seconds

Position Control

Absolute positioning places badges exactly where you want them

3 Code Implementation

{% comment %}
  Custom Badge on Products Using Product Tag
  Adds badges based on product tags (e.g., "new", "bestseller")
  Provided by XeeZone - www.xeezone.com/free-shopify-code-snippets-by-xeezone
{% endcomment %}

{% if product.tags contains 'new' %}
  <div class="product-badge new-badge" style="position: absolute; top: 10px; right: 10px; background: #FF5722; color: white; padding: 5px 10px; border-radius: 3px; font-size: 12px; font-weight: bold;">
    NEW
  </div>
{% endif %}

{% if product.tags contains 'bestseller' %}
  <div class="product-badge bestseller-badge" style="position: absolute; top: 10px; right: 10px; background: #4CAF50; color: white; padding: 5px 10px; border-radius: 3px; font-size: 12px; font-weight: bold;">
    BESTSELLER
  </div>
{% endif %}

4 Installation Guide

1

Access Product Template

Go to Online StoreThemesEdit code → Locate sections/product-template.liquid

2

Find Product Image

Search for the product image section (look for product.media or product.featured_image)

3

Insert Badge Code

Paste the snippet immediately after the product image container (within the same parent element)

4

Add Product Tags

In your product admin, add either 'new' or 'bestseller' tags to activate the badges

5

Customize Appearance

Modify the CSS in the snippet to match your store's design (colors, position, size)

Pro Tip: Create additional badge types by duplicating the code block and changing the tag name (e.g., 'sale') and styling. Use z-index: 1; to ensure badges appear above other elements.

Scroll to Top