I'm using Wordpress with WooCommerce. I've got this code which works (it was added to my 'functions.php' file).
/* add custom search options for Woocommerce */
add_filter( 'woocommerce_shop_order_search_fields', 'woocommerce_shop_order_search_order_total' );
function woocommerce_shop_order_search_order_total( $search_fields )
{
$search_fields[] = 'SERIAL_NUMBER';
return $search_fields;
}
SERIAL_NUMBER is a custom field I enter per product sold manually. The searching is working, but I have yet another serial that I sometimes search called "DATE_CODE".
How can I search for both?
I tried using:
$search_fields[] = 'SERIAL_NUMBER' + 'DATE_CODE';
But that didn't work because I assume it was searching for a serial number plus a date code in a single string combination (which isn't what I'm after). I'm after a method where I can search for either one :)
Thanks.