In the Product template, the Stock level indicator displays the relative availability of your product with a dynamic indicator bar that alerts customers when there are limited quantities.
Displaying your stock level can turn limited stock quantities into an advantage by conveying a sense of scarcity to increase conversion and quicker purchases.
The indicator bar visually represents the remaining percentage of your initial stock quantity, turns red when stock is low, and displays three different messages.
Set up stock level indicator
Shopify | Before adding a Stock level indicator block, you need to enable the Track quantity option for your product and product variants. See the Shopify guide about how to set up inventory tracking ↗.
Follow the steps below to set up the stock level indicator block, and enter a inventory base quantity and low level threshold.
STEPS
In your theme editor (Customize):
Select a Products template you want to edit.
Click (+) Add block and select Stock level indicator from the Theme Blocks list.
Click on the new Stock level indicator block to open the settings.
(Optional.) Toggle the Show label option to display or hide the "Stock" title above the indicator bar.
Enter the initial quantity of your product stock level in the Inventory base quantity field.
The indicator bar displays your remaining product quantity as a percentage of this base quantity. If your base quantity is set at 100 products, the bar will display at 100% when your have 100 products in stock and 60% when you have 60 products in stock.
Enter the product inventory quantity in the Low quantity threshold to alert customers when limited quantities are available.
When your current product inventory matches or goes below the Low quantity threshold, the indicator bar will turn red and display a "Limited quantities available" message.
(Optional.) Click and hold the drag handles ⋮⋮ to rearrange the blocks:
Click Remove block in the block settings to delete a block.
Click the Eye icon to hide or unhide a block.
Click Save.
Use dynamic sources for multiple products
If you need to set a different Inventory base quantity and Low inventory threshold for multiple products, you can use Shopify's metafields and dynamic sources.
Follow the steps below to create metafields for your products, add inventory numbers to those metafields, then use Dynamic sources to connect metafields to the stock level settings in your theme editor.
Shopify's Metafields lets you store additional information about your products. You can create custom fields to hold different types of information in your Shopify admin, and enter unique content for each of your products.
The steps below show you how to add two Number metafields for storing an inventory base quantity and Low stock threshold.
STEPS
In your theme editor (Customize):
Click the Stock Level Indicator block to open the settings.
Next to the Inventory base quantity field, click the Insert dynamic source button and select (+) Add Metafield.
Click the Products tab.
Click the Add definition button in the top-right.
Add a Name to the metafield that describes what it will be used for.
We recommend naming the metafield the same as the setting name: "Inventory base quantity" or "Low stock threshold".
Click (+) Select type button and select Number.
(Optional.) Repeat steps 4 - 5 to add another metafield for Low stock threshold.
Click Save.
2. Add quantity to number metafields
Once you've created number Metafields for your products, you can now add quantities those fields by going to your products in the Shopify admin.
STEPS
In your Shopify Admin:
Go to your Product inventory in your Shopify admin and open one of your Products.
Scroll down to the Metafields section.
Enter the Inventory base quantity or Low quantity threshold that you want for the product.
Repeat steps 1 - 3 to add the different quantities to the metafields of the products you want to display a Stock level indicator.
Click Save.
3. Insert metafields as dynamic sources
Now that the Metafields of your products have content, you can go to the theme editor to insert a Dynamic source to the Stock level indicator settings in the Products template.
STEPS
In your theme editor (Customize):
Click the Stock Level Indicator block to open the settings.
Delete the current quantity in the Inventory base quantity so the field is left blank.
Click the Insert dynamic source button next to Customer product list
Select the "Inventory base quantity" metafield you create.
(Optional.) Click the Dynamic source button next to the Low stock threshold to add a "Low stock threshold" metafield.
You can now preview your store to confirm the correct product list appears when viewing different products.