• Resolved robbsen1987

    (@robbsen1987)


    Hey,

    I have read all articles about this problem. But none of the snippets work.

    I have testet:

    add_filter( 'woocommerce_output_related_products_args', function( $args )
    {
        $args = wp_parse_args( array(
            'posts_per_page' => 4,
            'meta_query' => array (
               'key' => '_stock_status',
               'value' => 'instock'
        )
        ), $args );
        return $args;
    });

    But it didnt work.

    Any ideas how to hide the out of stock products ONLY from the related products?

    Thanks!
    Robb

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Hide out of stock products from related products’ is closed to new replies.