I think I fixed the search issue – at least it is working now, at my website.
However I don’t know what worked – my fix, or the latest update ??
Anyway here is the code that I used (in my theme functions.php)
function woocommerce_shop_order_search_fix( $search_fields ) {
$index = array_search('_alg_wc_full_custom_order_number', $array);
if($index !== false) {
unset($search_fields[$index]);
}
array_unshift($search_fields, '_alg_wc_custom_order_number');
array_unshift($search_fields, '_alg_wc_full_custom_order_number');
return $search_fields;
}
add_filter( 'woocommerce_shop_order_search_fields', 'woocommerce_shop_order_search_fix' );
Old orders will come up, at the bottom of search results – it searches for the specified number not only in custom order number, but also in customer phone, address, email etc.