Out of the box, Magento 2 gives your products exactly two stock labels: In Stock and Out of Stock. That's not much to work with — no "Only 3 left!" urgency, no "Ships next week" backorder note, no per-quantity messaging. Yet those little labels do real work: they set expectations, create urgency, and directly influence whether a hesitant shopper buys now or bounces.
The Custom Stock Status extension for Magento 2 removes that limitation: custom labels with icons, dynamic variables like the remaining quantity, and rules that switch the status automatically as inventory changes. In this guide, we'll set it up end to end — configuration, creating statuses, quantity rules, and what the result looks like in the backend and on the storefront.
5 Easy Steps to Set a Custom Product Stock Status in Magento 2
Step-1: Extension Configuration:
To enable the Custom Stock Status, go to Admin Panel > Stores > Configuration > Custom Stock Status and Enable the Custom Status Display Settings and set Yes to use Activated rules for Quantity Range Status field.
- Here you get the option to set Custom Status Display Settings and Custom Stock Status Settings.
In the Custom Status Display Settings, you can Enable/Disable the display of Custom Stock Status in below pages:
- Product List Page
- Product Detail Page
- Catalog Search List Page
- Shopping Cart Page
- Order Email
- Customer account section on frontend
- Order item section on admin
Under Custom Stock Status Settings, you get advanced settings to hide and display the custom stock status as follows:
- Hide Default Stock Status: set Yes to hide the default stock status on the store frontend.
- Display Only Custom Stock Status Icon: set Yes to display only custom status icon on the product view and product list pages.
- Display Quantity Ranges Based Statuses: set Yes to display the custom stock status based on quantity range.
- Use Activated rules for Quantity Range Status: set Yes to display the custom stock status on active rules for quantity range status.
- Display Custom Stock Status Only 'Out Of Stock' Product: If set to 'No', custom stock status displays in both 'in stock' and 'out of stock' products.
- Change Default Configurable Product Status: set Yes to display custom stock status on configurable products.
- Display Out of Stock Configurable Product Attributes: If set to 'Yes', out of stock configurations product display in the drop-downs of configurable products with no possibility to purchase.
- Enable `Back In Stock` Product Alert for Out of Stock Configurable: set Yes to display `Back In Stock` Product Alert on Out of Stock products.
Step-2: Add Custom Stock Status:
After Installation of the Extension, go to Stores → Attributes → Product and select mageants_custom_stock_status attribute.
In the Properties tab, set the Attribute Properties as per your requirement. After that open the Manage Options (values of your attribute) section.
- Here you can create the options for the custom stock status label.
- To display current product quantity in particular stock status, use the {qty} variable — for example: Only {qty} left in stock!
- Available variables: {qty}, {special_price}, {day-aftertomorrow}, and {tomorrow}.
Inside the Storefront Properties tab set the properties as per your desired configuration to display the custom stock status on frontend.
After creating labels for your custom stock status, now you can set icons for the same:
- Go to the Manage Option Icon tab.
- Choose icons for custom stock statuses.
Inside the custom stock status attribute, you also get the option to manage quantity range custom stock status. To enable quantity range, first you need to add custom stock rules.
Step-3: Add Quantity Rules for Custom Stock Status:
To add custom stock rules, go to Stores → Attributes → Product and select mageants_custom_stock_rule attribute.
In the Properties tab, open Manage Options (values of your attribute) section.
- Here you can add the rules for the custom stock status.
- You can create different rules for different product groups to apply on different levels of stocks.
- Once you create the rules, go to Manage Quantity Range and specify ranges for each of these rules.
After creating the custom stock rules go back to mageants_custom_stock_status attribute and open Manage Quantity Ranges Tab.
- Here you can manage quantity range status for different products.
- Set the Quantity From and Quantity To range for the custom stock status along with the custom stock status rule.
- If you would like the status to be updated automatically, based on the quantity of product left in inventory, please create quantity ranges and assign the necessary status to the ranges.
- You can also use the Stock Status Rule column. With its help, you can specify different quantity levels having the same status for different groups of products.
- Use backorder rules to automatically assign stock statuses to the products.
- If you choose to use range based stock status when editing a product, the stock status will change automatically once the product quantity changes.
To apply the quantity based status, go to Admin Panel → Catalog → Products. Select a product and save after setting below attributes present in the General section:
- Custom Stock Status: select the custom stock status for this product.
- Custom Stock Status Rule: select quantity rule to be applied to this product.
- Use Quantity Ranges Based Stock Status: set Yes to enable the custom stock status based on quantity range.
Step-4: Backend Example
Custom stock status can be seen in the order item section on backend order view as follows:
Step-5: Frontend Examples
- Display Custom Stock Status for simple products on the product list page.
- Display Custom Stock Status on Configurable, Bundle and Group products.
- Display Custom Stock Status on the product detail page.
- Display Custom Stock Status on the cart page.
- Display Custom Stock Status on Frontend order view.
Conclusion
With these five steps — configuration, status labels with icons, quantity rules, and the backend and frontend displays — your store communicates exactly what's happening with stock at every stage of the shopping journey, from product listings to cart to order view. Clear labels like "Only 3 left!" or "Back in stock tomorrow" manage expectations, build trust, and give hesitant shoppers the nudge that plain In Stock/Out of Stock never will.
If you haven't installed it yet, the Magento 2 Custom Stock Status extension page has the full feature list, demo, and documentation to get you started.