Out of Stock product show up in Ajaz Search
-
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?
Hello,
Please provide your admin access and FTP we will check the issue.
Best Regards
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?
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' );
}
That worked.
Thanks alot.
The topic ‘Out of Stock product show up in Ajaz Search’ is closed to new replies.