Support » Plugins and Hacks » Search orders by item order meta

Search orders by item order meta

  • I have downloadable products in my Woocommerce store that have associated serial numbers which I store in the ‘wp_woocommerce_order_itemmeta’ table. My customer service folks need to be able to search by serial number and bring up the order that has the product with the searched-for serial number. I tried this in my functions.php file:

    add_filter( 'woocommerce_shop_order_search_fields', 'woocommerce_shop_order_search_licensecodes' );
    function woocommerce_shop_order_search_licensecodes( $search_fields ) {
      $search_fields[] = '_licensecode';
      return $search_fields;

    but I am not getting any results when I search for the serial number. Any ideas what I can do to make this custom search work? Thanks!


Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Search orders by item order meta’ is closed to new replies.