| 开发者 | londom |
|---|---|
| 更新时间 | 2026年9月30日 06:54 |
| PHP版本: | 8.0 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
londom_alternatives_count - Change number of alternatives shownlondom_alternatives_title - Customize the heading textlondom_alternative_products_query_args - Modify the query for finding alternativeslondom_should_replace_add_to_cart - Control when replacement happenslondom_oos_display_hook - Change the hook where the block is printedlondom_oos_display_priority - Change the priority on that hooklondom_use_context_aware_cache - Enable context-aware cachingfunctions.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;
});
`The plugin only displays alternatives when a product is completely out of stock:
Yes! Use this filter in your theme's functions.php:
add_filter( 'londom_alternatives_count', function() { return 6; });
The plugin uses a smart two-step process:
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.
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.
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.
Yes! Built-in compatibility with:
Yes! The plugin is fully translation-ready:
londom-out-of-stock-alternativesThe cache clears automatically when:
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.Yes! The plugin declares full compatibility with WooCommerce HPOS.
Not yet, but we're working on advanced features for a PRO version. The FREE version will always remain feature-complete for basic needs.
londom_oos_display_hook and londom_oos_display_priority filters to change where the block is printed_e() with esc_html_e() for safe output