How to add low stock feature to product pages?

Topic summary

A store owner wants to add a low stock indicator on product pages to create urgency when inventory runs low. They’ve tried existing code snippets but haven’t successfully implemented the feature in the desired location (near quantity or price).

Solutions offered:

  • Custom Liquid code approach: A developer provided sample code using {% if current_variant.inventory_quantity < 5 %} to display an “Almost Sold Out” message when stock falls below 5 units. This requires modifying the product section template.

  • App-based solution: An alternative suggestion is to use a dedicated Shopify app like “Hey! Low Stock Counter” from the app store, which requires no coding.

The discussion remains open as the original poster hasn’t confirmed which solution they’ll pursue or whether either approach resolved their issue.

Summarized with AI on November 13. AI used: claude-sonnet-4-5-20250929.

I’ve been looking around on how to add the low stock display to my product page when my stock gets low to create urgency, but so far all the coding I’ve found doesn’t work with my page or displays the low stock feature in the wrong spot. I want the low stock feature to display beside quantity or beside the price. Can anyone help me out?

Store url: https://monteithoutfitters.com/

@TM_Outfitters , I can help you with this.

It requires some custom coding to implement.

1 Like

Hi @TM_Outfitters ,

You can modify product section. Liquid example code below:

{% if 
current_variant.inventory_quantity **<** 5 
and current_variant.inventory_management == 'shopify' %}
 <p>Almost Sold Out!</p>
{% endif %}

Regards,

Sam - Owner Lead Developer

Achieve Applabs

Hi there, if you do not want to do coding by yourself, you can check for low stock apps in the app store. One of them is Hey! Low Stock Counter which does not require any coding on your end.