The issue here is that the Back Order badge will always appear even when the product is in stock so I need to add an additional clause to the elseif statement, I’ve tried calling things like inventory_quantity <=0 and even tried using a collection with auto rules that gather up all the out of stock items to try and call collection.title contains ‘out of stock’ but none of these seem to work.
{%- elsif card_product.tags contains 'Back Order' and collection.title contains 'Out of Stock' -%}
Is there any other way to produce the check so I can implement this on the collection page so customers don’t need to click into each product to see the Click to Backorder replacement I’ve done for the add to cart button:
You can seek the support of a 3rd party app like Product Labels & Badges. This tool will address various badge-related issues without needing code (or our dev team will be ready to assist you if needed). To create the badge as you desire, follow my steps below:
Install the app and enable app embed.
Create and customize the text label, setting it in your desired position at the bottom right corner of the product image.
Shopify doesn’t have a native solution for badges based on both product tags AND inventory levels. You’ll need to edit your theme’s card-product.liquid file. Navigate to Online Store → Themes → Edit code → find card-product.liquid, then modify the Back Order badge conditional to check both the tag AND that total inventory across variants is ≤ 0. Here’s Shopify’s Liquid documentation for reference.
The main limitation: native badges can’t check inventory without custom Liquid, and you’ll need to loop through variants to calculate stock.
Alternatively, an app like K1 PreOrder can automate this (full disclosure: I’m the founder). Create a Shopify smart collection with conditions (tag = “Back Order”), link it to a K1 rule with Out of stock display mode, and the badge appears only when both conditions are met - no code needed. The collection syncs automatically when stock or tags change. If relevant, here’s the K1 PreOrder listing.
Happy to help with the Liquid customization if needed.