woocommerce search by sku and title ajax
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’ … Read more