Linux 软件免费装
Banner图

InStock First – Sold Out Products Last for WooCommerce

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

标签

woocommerce out of stock product sorting sold out stock status

下载

1.0.0

详情介绍:

Shoppers who land on a category full of "Out of stock" badges leave. InStock First keeps what you can actually sell at the top: in-stock products are shown first and sold-out products move to the end of the list, without hiding them (so you keep their SEO and customers can still sign up for restock alerts). It works the moment you activate it. There is nothing to configure and nothing to re-run: the order is applied when the page loads, so a product that comes back in stock moves straight back up, and a product that sells out drops to the end on its own. What it does (free, no limits)

安装:

  1. Install and activate WooCommerce.
  2. Go to Plugins → Add New, search for "InStock First", install and activate.
  3. That's it. Sold-out products now appear last. Optional settings: WooCommerce → Settings → Products → Sold-out order.

屏幕截图:

  • Settings: WooCommerce → Settings → Products → Sold-out order.
  • Your normal sorting (here "price: low to high") is kept inside the in-stock and sold-out groups.

升级注意事项:

1.0.0 First release.

常见问题:

Does this hide out of stock products?

No. They stay visible, just at the end. If you want to hide them completely, WooCommerce has a built-in option (WooCommerce → Settings → Products → Inventory → "Hide out of stock items from the catalog").

Will it change my product order or data?

No. Nothing is written to your products. The order is calculated when the listing is shown, so deactivating the plugin restores your previous order instantly.

Does it work with sorting by price, popularity or newest?

Yes. Within the in-stock group and within the sold-out group your chosen sorting still applies.

What about products on backorder?

You choose: treated as in stock (default), shown between in-stock and sold-out products, or treated as sold out.

Does it work with caching plugins?

Yes. Cached pages update when your cache refreshes, the same as any stock change.

Does it work with the block editor "Product Collection" block or page builders?

Version 1.0 covers the classic shop, category, tag, attribute and search pages (including block themes' product archive templates that use the main query) and the [products] shortcode. Custom loops can opt in with the instock_first_applies_to_query filter.

Does the plugin collect any data?

No. The plugin does not collect, store or send any data, and it makes no external requests.

Developer hooks

  • instock_first_applies_to_query (bool $apply, WP_Query $query): turn reordering on or off for any query.
  • instock_first_rank_cases (array $ranks): map stock statuses to sort ranks (lower is earlier).
  • instock_first_rank_sql (string $sql, string $alias, WP_Query $query): replace the rank SQL expression.

更新日志:

1.0.0