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

    (@mihail-barinov)

    Hi

    It is something that must be added to the next version.
    For now you can manually add some lines of code to enable this feature.

    Add this

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

    To the class-aws-table.php file after this lines of code

    foreach ( $posts as $post ) {
    
                    $terms = array();
    
                    $id = $post->ID;
    Thread Starter gck303

    (@gck303)

    I have done this, and now I get an error:

    Parse error: syntax error, unexpected ‘&’, expecting ‘]’ in /home/content/p3pnexwpnas09_data03/78/2849378/html/wp-content/plugins/advanced-woo-search/includes/class-aws-table.php on line 110

    Plugin Author ILLID

    (@mihail-barinov)

    Are you sure that you don’t delete any lines of code?

    Thread Starter gck303

    (@gck303)

    Yes, I am sure.

    Any chance you could just provide the replacement php file?

    I tried this same code, and it does not seem to hide the out of stock products from the search. Any help here would be greatly appreciated!

    I also tried that code but didn’t work.

    • This reply was modified 7 years, 8 months ago by priyadilsha.
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How to exclude out-of-stock products?’ is closed to new replies.