Created
February 23, 2024 11:44
-
-
Save tdmrhn/9614fe9d0f049cf422bec927c94fd26b to your computer and use it in GitHub Desktop.
Blocksy 2 Exclude Out of Stock products from related and upsells
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'woocommerce_output_related_products_args', function ( $args ) { | |
$args['status'] = 'publish'; | |
$args['limit'] = -1; | |
$args['stock_status'] = 'instock'; | |
return $args; | |
}, 10, 1 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment