• techispot.com

    (@techispotcom)


    in admin area want to search product though sku but there is no option available

Viewing 1 replies (of 1 total)
  • Plugin Author Andrew Stichbury

    (@andrewstichbury)

    Hi techispot.com,

    Custom fields can be made searchable by adding the following to your theme’s function file:

    add_filter( 'admin_search_meta_queries', function( $fields, $post_type ) {
    
    	if ( 'product' === $post_type ) {
    		$fields[] = '_sku';
    	}
    
    	return $fields;
    
    }, 10, 2 );

    As Woocommerce is a popular plugin, I have included SKU as a searchable field in the latest update (1.3.2) of the plugin.

    Hope that helps!

Viewing 1 replies (of 1 total)
  • The topic ‘can not search via sku’ is closed to new replies.