Description
WooCommerce tells shoppers “Out of stock” and leaves it there. Stockline lets you say something useful instead: “Only 2 left, order soon”, “Made to order, ships in 2–3 weeks”, “Sold out, ask us about restocking”.
Your own message for every stock state
- In stock: e.g. “In stock, ships today”. Also shown for products that don’t track stock, where WooCommerce shows nothing.
- Low stock: e.g. “Only {qty} left, order soon”, using WooCommerce’s own low stock threshold (store-wide or per product).
- On backorder: e.g. “Ships in 2–3 weeks”.
- Out of stock: e.g. “Sold out, back soon”.
Leave any message empty to keep WooCommerce’s text, with your icon and colour. Other plugins can add states of their own, such as a “Pre-order” state, and they get a message, icon and colour on the same screen.
Looks right in your theme
- Icons (check mark, warning, clock, cross, delivery truck, dot) and a colour per state.
- Plain text or a soft coloured badge.
- A live preview of each state on the settings screen as you type, before you save.
- Keeps WooCommerce’s own CSS classes, so your theme’s styling still applies.
Works everywhere WooCommerce shows stock
Classic themes, block themes (the Add to Cart form block) and variable products, where the message updates as shoppers pick options. Stockline hooks the final stock HTML that WooCommerce itself builds, so there are no template overrides to go stale after WooCommerce updates.
Placeholders and light HTML
Use {qty} for the units left and {product} for the product name. Bold text and links are allowed, e.g. Sold out, <a href="/contact">ask us about restocking</a>.
For developers
stockline_stock_htmlfilters the final markup ($html,$product,$state).stockline_states,stockline_stateandstockline_placeholderslet other plugins add a state with its own message, icon and colour, and placeholders for it. Preorderline uses them for a “Pre-order” state with{date}.stockline_product_settingslets a plugin give a product or variation its own message, icon or colour, andstockline_page_colorsadds the colours it uses to the page’s stylesheet.stockline_enqueue_stylesloads the small stylesheet beyond product pages, e.g. for a Single Product block on a landing page.stockline_loadedfires once Stockline has loaded, for add-ons.
Stockline Pro
Stockline’s messages are store-wide. If some products need their own (“Back mid-November”, or “Size S is back in December” for one variation), the separate Stockline Pro add-on adds a message, icon and colour per product and per variation, a preview dialog on the product screen, and columns for them in the Gridline bulk editor. Everything described above works without it. See extendiment.com/plugins/stockline. Stockline Pro is sold under our Terms and Privacy Policy.
Screenshots






Installation
- Install and activate Stockline from Plugins Add New Plugin, or upload the zip there. WooCommerce must be active.
- Go to WooCommerce Settings Products Stock messages.
- Pick a style (plain text or badge), then set a message, icon and colour for each stock state. The preview under each state shows the result as you type.
- Save, and open a product page to see the new stock line.
FAQ
-
Does it change how stock works?
-
No. Stockline only changes the message shoppers see. Stock levels, backorders and the low stock threshold are still WooCommerce’s settings.
-
Where does the low stock number come from?
-
From WooCommerce: the product’s own low stock threshold, or the store-wide one under WooCommerce Settings Products Inventory.
-
Why don’t I see an “In stock” message on some products?
-
WooCommerce shows nothing for in-stock products that don’t track stock. Set an In stock message in Stockline to show one there too.
-
Can a product or variation have its own message?
-
Stockline’s messages, icons and colours apply to the whole store. Variations show the store’s message for their stock state, with their own quantity in
{qty}. -
Does it work with block themes?
-
Yes. The product page in block themes renders stock through the same WooCommerce function Stockline hooks into.
-
Can I style it further?
-
Yes. The line has the classes
stockline,stockline--{state}(in-stock,low-stock,backorder,out-of-stock) andstockline--plainorstockline--badge, plus WooCommerce’s ownstockclasses. The colour is a CSS variable,--stockline-color, set by astockline--color-{hex}class (e.g.stockline--color-cf222e). -
The stock line didn’t change after I saved. Why?
-
Usually a page cache: clear your caching plugin’s or host’s cache and reload the product page. If it still shows WooCommerce’s text, check that the message for that state isn’t empty (empty keeps WooCommerce’s wording) and that your theme shows the stock line at all.
-
What happens to my data if I delete Stockline?
-
When you click Deactivate on the Plugins screen, Stockline asks what should happen to its data if you then delete the plugin. Keep it (the default) and your stock messages, icons and colours are still there if you install Stockline again. Choose Delete it permanently when the plugin is deleted to have them removed when you delete it. Deactivating alone never removes anything, and your products and their stock levels are never deleted.
-
Can I translate Stockline?
-
Yes, on translate.wordpress.org. The template is also included as
languages/stockline.potfor tools such as Poedit or Loco Translate.
Reviews
There are no reviews for this plugin.
Contributors & Developers
“Stockline – Custom Stock Messages for WooCommerce” is open source software. The following people have contributed to this plugin.
ContributorsTranslate “Stockline – Custom Stock Messages for WooCommerce” into your language.
Interested in development?
Browse the code, check out the SVN repository, or subscribe to the development log by RSS.
Changelog
1.0.0
- First release.
