Linux 软件免费装
Banner图

LONDOM - Out of Stock Alternatives

开发者 londom
更新时间 2026年9月30日 06:54
PHP版本: 8.0 及以上
WordPress版本: 7.1
版权: GPLv2 or later
版权网址: 版权信息

标签

woocommerce upsell out of stock stock management alternatives

下载

1.3.5 1.4.0

详情介绍:

Keep customers shopping when a WooCommerce product is out of stock. When a customer lands on an out-of-stock product page, LONDOM - Out of Stock Alternatives shows a box of available alternatives at the top of the page, above the product, so they can pick another product instead of leaving. The box lists up to 4 products (filterable):
  1. Your upsells first - the upsell products you set in the product's Linked Products tab, if they are in stock.
  2. Then products from the most specific category - if there is room left, in-stock products from the most specific category assigned to the product, ordered by sales. A broad parent category (for example "Men") is ignored when the product is also in a narrower one (for example "Wallets"), so suggestions stay relevant.
If nothing is available, the box says so instead of showing unrelated products. A "View all" button leads to the product's main category (the primary category set in Yoast SEO or Rank Math, when present). Key Features How It Works
  1. Detection - The plugin detects that a simple product, or every variation of a variable product, is out of stock
  2. Notice and alternatives - A short notice and the alternatives box are printed above the product
  3. Selection - Up to 4 in-stock products: upsells first, then the most specific category
  4. Caching - Alternative IDs are cached and re-validated on each page load, so sold-out products are filtered out when the page is generated
Perfect For Developer Friendly Multiple filters and actions available for customization: Requirements Support For support, please use the WordPress.org support forum.

安装:

Automatic Installation
  1. Log into your WordPress admin panel
  2. Navigate to Plugins → Add New
  3. Search for "LONDOM Out of Stock Alternatives"
  4. Click "Install Now" and then "Activate"
Manual Installation
  1. Download the plugin ZIP file
  2. Log into your WordPress admin panel
  3. Navigate to Plugins → Add New → Upload Plugin
  4. Choose the ZIP file and click "Install Now"
  5. Activate the plugin
After Activation The plugin works automatically! Visit any out-of-stock product page to see the alternatives block in action. Optional Configuration: You can customize behavior using WordPress filters in your theme's functions.php: ` // Change number of alternatives shown (default: 4) add_filter( 'londom_alternatives_count', function() { return 6; }); // Customize the heading text add_filter( 'londom_alternatives_title', function() { return 'You might also like these'; }); // Enable context-aware caching (for multilingual/multi-currency sites) add_filter( 'londom_use_context_aware_cache', '__return_true' ); // Change where the block is printed (defaults: woocommerce_before_single_product, priority 20) add_filter( 'londom_oos_display_hook', function() { return 'woocommerce_before_single_product'; }); add_filter( 'londom_oos_display_priority', function() { return 20; }); `

屏幕截图:

  • Mobile view with responsive grid layout
  • Alternative products with prices and images

升级注意事项:

1.4.0 The block is now printed outside div.product: check any custom CSS that targets it. Texts are now in English; on non-English sites they stay in English until the translation is available on translate.wordpress.org. 1.3.2 Important update for WordPress.org compliance. Aligns text domain with plugin slug and improves code quality. No breaking changes. Safe to update. 1.3.1 Improved cache system and better product placement. Recommended update for all users. 1.3.0 First stable release. Install and activate to start showing alternatives on out-of-stock products.

常见问题:

Why isn't the alternatives block showing?

The plugin only displays alternatives when a product is completely out of stock:

  • For simple products: stock must be 0 and backorders disabled
  • For variable products: ALL variations must be out of stock or unavailable Check your product's stock settings in WooCommerce.

Can I change how many alternative products are shown?

Yes! Use this filter in your theme's functions.php: add_filter( 'londom_alternatives_count', function() { return 6; });

How are alternative products selected?

The plugin uses a smart two-step process:

  1. First priority: Upsell products (that are in stock)
  2. Fallback: Products from the most specific categories assigned to the product, ordered by sales performance This ensures relevant recommendations every time.

Is it compatible with my theme?

Yes! The plugin uses standard WooCommerce hooks and includes mobile-first CSS that adapts to most themes. The styles are minimal and designed to blend with your existing design.

Does it work with variable products?

Absolutely! The plugin intelligently checks all variations. If even ONE variation is available (in stock or with backorders enabled), the normal Add to Cart remains visible.

Will it slow down my site?

No. The plugin includes an intelligent caching system that stores alternative product IDs and validates them on each page load. This "soft-refresh" approach keeps data accurate while maintaining performance.

Is it compatible with caching plugins?

Yes! Built-in compatibility with:

  • WP Rocket
  • W3 Total Cache
  • LiteSpeed Cache
  • WP Fastest Cache The plugin automatically purges relevant cache when products are updated.

Can I translate the plugin?

Yes! The plugin is fully translation-ready:

  • Text domain: londom-out-of-stock-alternatives
  • Compatible with Polylang and WPML
  • All user-facing strings are translatable

How do I clear the plugin's cache?

The cache clears automatically when:

  • A product is updated
  • Stock status changes
  • Prices change
  • Upsells are modified For manual clearing, deactivate and reactivate the plugin.

Can I customize the appearance?

Yes! The plugin includes CSS classes you can target:

  • .londom-oos-wrap - The wrapper around the notice and the alternatives
  • .londom-oos-banner - The "out of stock" notice
  • .londom-oos-box - The alternatives container
  • .londom-oos-grid - The product grid
  • .londom-oos-item - Individual product cards Add custom CSS in Customizer → Additional CSS.

Does it support HPOS (High-Performance Order Storage)?

Yes! The plugin declares full compatibility with WooCommerce HPOS.

Is there a PRO version?

Not yet, but we're working on advanced features for a PRO version. The FREE version will always remain feature-complete for basic needs.

更新日志:

1.4.0 - 2026-09-26 1.3.5 - 2026-02-10 1.3.4 - 2026-02-10 1.3.2 - 2025-01-22 1.3.1 - 2024-12-10 1.3.0 - 2024-11-15