Pls Try this code
if(is_numeric($search_keyword)){
$args = array(
'posts_per_page' => 3,
'post_type' => 'product',
'meta_query' => array(
array(
'key' => '_sku',
'value' => $search_keyword,
'compare' => 'LIKE'
)
)
);
}
else if(is_string($search_keyword)){
$args = array(
's' => $search_keyword,
'post_type' => 'product',
'post_status' => 'publish',
'ignore_sticky_posts' => 1,
'posts_per_page' => 3,
'orderby' => $ordering_args['orderby'],
'order' => $ordering_args['order'],
'suppress_filters' => false,
'tax_query' => array(
array(
'taxonomy' => 'product_visibility',
'field' => 'term_taxonomy_id',
'terms' => $product_visibility_term_ids['exclude-from-search'],
'operator' => 'NOT IN',
),
),
);}