Home Forums WoodMart support forum Out of Stock product show up in Ajaz Search

Out of Stock product show up in Ajaz Search

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #54573

    Thofr
    Participant

    Hi,

    I’ve hidden the Out of Stock products from the catalog (in WooCommerce Stock settings). However when a customer searches for a product with Ajax Search these products show up.

    Is there a way to prevent that from happening?

    #54605

    Hello,

    Please provide your admin access and FTP we will check the issue.

    Best Regards

    #54784

    Thofr
    Participant

    This is a live site. But your answer suggests that you dont’t have that problem on your end. Can you confirm that when you’ve
    1) Set the out of stock visibility to: do not display products
    2) And you search for a product that is out of stock with Ajax Search

    that product is not shown in the Ajax search results?

    #54792

    Artem Temos
    Keymaster

    Try to edit the file woodmart/inc/classes/Search.php and add the following code here http://prntscr.com/jaew8k

    if ( 'yes' === get_option( 'woocommerce_hide_out_of_stock_items' ) ) {
    	$query_args['meta_query'][] = array( 'key' => '_stock_status', 'value' => 'outofstock', 'compare' => 'NOT IN' );
    }
    #55321

    Thofr
    Participant

    That worked.

    Thanks alot.

    #55327

    Artem Temos
    Keymaster

    Great, you are welcome!

Tagged: 

Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘Out of Stock product show up in Ajaz Search’ is closed to new replies.