Note on product variants that appears/disappears based on stock availability

Topic summary

A user seeks to display a conditional note on product pages that appears only when items are set to “continue selling when out of stock” (pre-order mode).

Proposed Solutions:

  • Custom code implementation: One responder confirms this is achievable through theme file customization and offers hands-on assistance via private message with store URL and collaboration code.

  • Technical approach for single variants:

{% assign v = product.selected_or_first_available_variant %}
{% if v.inventory_policy == "continue" and v.inventory_quantity <=0 %}
  output message
{% endif %}

Considerations:

  • The provided code works for single-variant products
  • Products with multiple variants having different inventory policies would require JavaScript implementation
  • Specific solution depends on the theme structure

The discussion remains open, awaiting the original poster’s response to proceed with implementation.

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

Hi All,

I’m trying to set up a note on products/variants that is only shown when the item is set to continue to sell when out of stock (pre-order). Is anyone able to help me implement this?

Many Thanks,

Greens

Hey, this is possible to show the message on the product page for the specific one if it’s set to the Continue Selling when out of stock but it requires to do the custom code in your theme file.
Could you please share your store url and collab code so that I can implement the requested changes. You can share the requested detail in the p/m.
Thanks

You can start with the code like this


{% assign v = product.selected_or_first_available_variant %}
{% if v.inventory_policy == "continue" and v.inventory_quantity <=0 %}
  output message
{% endif %}

This would be enough if your products have only one variant.

If more, and inventory policy is different on them, you’d need some Javascript, but this is hard to suggest without seeing your theme.

1 Like

Hey,

Unfortunately Shopify doesn’t include a built-in way to automatically show conditional text based on inventory policy without theme customization. You’ll need to edit your theme code in Online StoreThemesActionsEdit code, then locate the product template (typically main-product.liquid) and add Liquid logic checking if variant.inventory_policy == 'continue' and variant.inventory_quantity <= 0 to display your pre-order note when those conditions are met. Shopify’s theme editing guide covers the basics.

The main trade-off is manually adding code, which requires theme knowledge and maintenance through updates.

Alternatively, an app like K1 PreOrder can automate this (I’m the founder), replacing the button with customizable text and displaying custom messages based on inventory conditions—without theme code changes. If relevant, here’s K1 PreOrder listing.

Happy to help with the theme customization if needed.

Best regards,
Yauheni