Add Custom Sale label to Be Yours Theme

Topic summary

A user seeks help automating custom product badges (like “sale,” “local,” “new”) for the Be Yours Shopify theme using product tags instead of manual metafield entry. They previously implemented a “pre-owned” badge but can’t recall the process.

Proposed Solution:
A community member provides a step-by-step automation approach:

  • Tag standardization: Use consistent tags like badge-sale, badge-local, badge-new
  • Code implementation: Modify the product card template (snippets/card-product.liquid) with conditional Liquid code that checks for specific tags
  • Styling: Each badge type gets custom CSS variables for background/foreground colors (e.g., blue for pre-owned, red for sale)
  • Consistency: Apply the same logic to product page templates for uniform badge display

Outcome:
Once implemented, badges automatically appear when corresponding tags are added to products, eliminating manual configuration. The solution includes ready-to-use code snippets with color customization options. The discussion remains open for implementation assistance.

Summarized with AI on October 27. AI used: claude-sonnet-4-5-20250929.

I’m looking for help adding a custom label/badge to the Be Yours theme. They offer an option in a meta description setup but I would rather use a simple code for automation of product tags vs having to select the option in inventory entry.

I have one already in place “pre-owned” though I can’t remember how I did this. So I would like to start over the right way. I would like the ame blue badge as I have now with another variant of text - sale, local (for local artisans), new. etc

website www.inplacejh.com/shop

Hi - yes I would really appreciate the step by step. I have tried to retrace my steps for the original pre-owned coding and Im lost.

Thank you.

Hi @catch22 ,

I’d be happy to help you set up an automated badge system for your Be Yours theme! Looking at your current “PRE-OWNED” badge, I can see exactly how it’s structured, which makes this much easier to replicate.

Here’s how to create an automated system using product tags:

Step 1: Set Up Your Product Tags First, you’ll want to standardize your product tags in Shopify. Use simple, consistent tags like:

  • badge-sale
  • badge-local
  • badge-new
  • badge-preowned

Step 2: Modify Your Product Card Template You’ll need to edit your theme’s product card template (usually found in snippets/card-product.liquid or similar). Replace your current badge code with something like this:

{% if product.tags contains 'badge-preowned' or product.tags contains 'badge-sale' or product.tags contains 'badge-local' or product.tags contains 'badge-new' %}
  <div class="card__badge">
    {% if product.tags contains 'badge-preowned' %}
      <span class="badge" style="--color-badge-background: #343f5c; --color-badge-border: var(--color-badge-background); --color-badge-foreground: #ffffff;">
        PRE-OWNED      </span>
    {% elsif product.tags contains 'badge-sale' %}
      <span class="badge" style="--color-badge-background: #d73527; --color-badge-border: var(--color-badge-background); --color-badge-foreground: #ffffff;">
        SALE      </span>
    {% elsif product.tags contains 'badge-local' %}
      <span class="badge" style="--color-badge-background: #2d7a2d; --color-badge-border: var(--color-badge-background); --color-badge-foreground: #ffffff;">
        LOCAL      </span>
    {% elsif product.tags contains 'badge-new' %}
      <span class="badge" style="--color-badge-background: #ff6b35; --color-badge-border: var(--color-badge-background); --color-badge-foreground: #ffffff;">
        NEW      </span>
    {% endif %}
  </div>
{% endif %}

Step 3: Apply to Product Pages Too You’ll also want to add similar logic to your main product page template (sections/product-form.liquid or similar) so badges appear consistently.

Step 4: Add the Tags Now you can simply add the appropriate tag to any product (like badge-sale) and the badge will automatically appear!

This approach gives you complete automation - just tag your products and the badges appear automatically. Much easier than manually setting options for each product!

Let me know if you need help implementing this or if you’d like me to adjust the colors or add more badge types.

Best,

Shubham | Untechnickle