• Resolved priyadilsha

    (@priyadilsha)


    Hi,

    Thanks for the great plugin. How to exclude out-of-stock products from search results ? I tried below code but it didn’t work. Any help?

    if ( isset( $custom['_stock_status'] ) && $custom['_visibility'][0] == 'outofstock' ) {
                        continue;
                    }

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author ILLID

    (@mihail-barinov)

    Hi,

    PLease open includes/class-aws-table.php file and after line

    $product = wc_get_product( $id );

    add

    if ( $product->stock_status === 'outofstock' ) {
        continue;
    }

    This must help you.

    Thread Starter priyadilsha

    (@priyadilsha)

    Thanks so much for the reply. I’ll try.

    Thread Starter priyadilsha

    (@priyadilsha)

    Thanks so much. It worked.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to exclude out-of-stock products?’ is closed to new replies.