Linux 软件免费装
Banner图

Stockline – Custom Stock Messages for WooCommerce

开发者 extendiment
更新时间 2026年10月13日 23:19
PHP版本: 7.4 及以上
WordPress版本: 7.1
版权: GPLv2 or later
版权网址: 版权信息

标签

woocommerce out of stock backorder stock status low stock

下载

1.0.0

详情介绍:

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 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 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 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.

安装:

  1. Install and activate Stockline from Plugins → Add New Plugin, or upload the zip there. WooCommerce must be active.
  2. Go to WooCommerce → Settings → Products → Stock messages.
  3. 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.
  4. Save, and open a product page to see the new stock line.

屏幕截图:

  • Low stock: your own wording with the quantity left, from the store’s low stock threshold.
  • On backorder: tell shoppers when it ships instead of “Available on backorder”.
  • Variations get their own stock line as shoppers pick options.
  • Settings: message, icon and colour for each stock state, with a live preview as you type.
  • Pick the plain text style and the previews follow before you save: the same messages and icons in the state’s colour, without the badge.

常见问题:

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) and stockline--plain or stockline--badge, plus WooCommerce's own stock classes. The colour is a CSS variable, --stockline-color, set by a stockline--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.pot for tools such as Poedit or Loco Translate.

更新日志:

1.0.0