Order search not working
-
I manually hid the products with this code:
add_action ( ‘pre_get_posts’, ‘hide_out_of_stock_in_search’) ;
function hide_out_of_stock_in_search ($query){
if($query->is_search() && $query->is_main_query()){
$query->set (‘meta_key’,’_stock_status’);
$query->set (‘meta_value’,’instock’);
}
}
This code also “breaks” the “order search” in adminpage. I can’t find orders by name or order number. How could this be fixed?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Order search not working’ is closed to new replies.