[HORIZON THEME] Needing code so that product badges show as "SOLD OUT", "COMING SOON", etc.

Topic summary

A Shopify store owner selling one-off leather items needs custom product badges that automatically display based on product status: “COMING SOON” for tagged items, “PORTFOLIO” for portfolio pieces, and “SOLD OUT” for zero-inventory products without manual tagging.

Challenge: Existing solutions require manually tagging sold-out items, which isn’t practical for this use case. The owner attempted tutorials for Dawn and Prestige themes without success.

Solution Provided: A community member shared step-by-step code implementation for the Horizon theme:

  • Navigate to snippets > product-card-badges.liquid
  • Insert custom code that checks product tags and inventory status
  • The code automatically displays “COMING SOON” for tagged products, falls back to “SOLD OUT” when product.available == false, and shows sale badges when applicable
  • Includes screenshots demonstrating code placement, product tagging, and expected output

The solution addresses the automation requirement by checking inventory status programmatically rather than relying on manual tags for sold-out items.

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

Website: https://rowsomeleather.com/

I sell leather items that are almost exclusively one-off items.

I need the following thing to happen:

Products tagged as “coming soon” have a badge of COMING SOON.

Products tagged as “portfolio” have a badge of PORTFOLIO.

All products with a zero inventory are otherwise tagged as SOLD OUT.

The only way I have found to achieve this, would require I manually tag all sold out items accordingly, which isn’t practical for me. If anyone knows of some code that would work, I would be eternally grateful!

Hey @RowsomeLeather ,

This need to take a look in your theme file.

Would you like to share the store collab code in the p/m.

Thanks

Hello @RowsomeLeather ,

Go to Snippets → product-card-badges.liquid
Here at line no. 26 you will find the code of the existing badge ‘sold out’ you can extend it to apply ‘coming soon’ and ‘portfolio’ badge a/to you need.

Let me know if you need me to apply this for you. You can drop me an email for services.

Regards
Guleria

@RowsomeLeather that’s an advanced theme customization.

To DIY there are existing discussions for older themes you can search for to try and apply similar process.

Meanwhile if you just need this customization take care of then contact me for services.
Contact info in forum signature below :down_arrow: :down_arrow: :down_arrow:.
ALWAYS please provide context, examples: store url, theme name, post url(s) , or any further detail in ALL correspondence.

I tried a number of tutorials for themes such as Dawn and Prestige, and didn’t have success.

I understand that, and can do it to some degree, but not quite.

  1. Log in to your Shopify Admin Panel
  2. Go to: Online Store > Themes
  3. Find your current theme (e.g., Horizon theme).
  4. Click “Actions (…)” and select “Edit Code
  5. In the left-hand sidebar go to snippets > product-card-badges.liquid.
  6. Add the provided code according provided screenshot given below.
{%- assign tags = product.tags | join: ',' | downcase -%}
{%- if tags contains 'coming soon' -%}
  COMING SOON
{%- elsif product.available == false -%}
  {{ 'content.product_badge_sold_out' | t }}
{%- elsif product.compare_at_price > product.price -%}
  {{ 'content.product_badge_sale' | t }}
{%- endif -%}

  1. Please add the tag to your products

  1. Expected output

If this helped, don’t forget to Like it and Mark it as a Solution!