I need to show all the products with stock only in some particular page.
In my case, the page ID is: post=36886
I tried this code just for testing purposes trying to see if something happen (I know this is for hide products) but nothing happens.
add_filter( 'pre_option_woocommerce_hide_out_of_stock_items', 'we_hide_out_of_stock_exception' );
function we_hide_out_of_stock_exception( $hide ) {
if ( is_page( 36886 ) ) {
$hide = 'no';
}
return $hide;
}
So, I’m stuck there. Any help will be appreciated.