Woocommerce filter products on admin grid by custom field
<p>I have added manufacture column in product admin grid in woocommerce. Now i want to search product by manufacturer also. I have added manufacture_id in post_meta for products.</p>

<p>I have to search manufacture first by search term and if any manufacture exist then search for manufacture id in product post_meta field. It may also return multiple manufactures.</p>

<p>I am using following filter:</p>

<pre><code>add_filter( 'parse_query', 'ls_product_posts_filter' );

function ls_product_posts_filter( $query ){
    global $pagenow;

    $type = 'product';
    if (isset($_GET['post_type'])) {
        $type = $_GET['post_type'];
    }
    if ( 'product' == $type &amp;&amp; is_admin() &amp;&amp; $pagenow=='edit.php') {
        $query-&gt;query_vars['meta_key'] = 'manufacture_id';
    }
}
</code></pre>

<p>Thanks.</p>