I have this code in my themes' shortcode to display featured product rating product like this. But I need to get product by category show. Which code do I have to add. Any suggestions?
if($type == 'featured'){
/**********QUERY FOR FEATURED PRODUCT**********/
$query_args = array('posts_per_page' => $number, 'no_found_rows' => 1, 'post_status' => 'publish', 'post_type' => 'product' );
$query_args['meta_query'] = array();
$query_args['meta_query'][] = array(
'key' => '_featured',
'value' => 'yes'
);
$query_args['meta_query'][] = $woocommerce->query->stock_status_meta_query();
$query_args['meta_query'][] = $woocommerce->query->visibility_meta_query();
/**********END QUERY FOR FEATURED PRODUCT**********/
}elseif($type == 'top-rated'){
/**********QUERY FOR TOP-RATED PRODUCT**********/
add_filter( 'posts_clauses', array( $woocommerce->query, 'order_by_rating_post_clauses' ) );
$query_args = array('posts_per_page' => $number, 'no_found_rows' => 1, 'post_status' => 'publish', 'post_type' => 'product' );
$query_args['meta_query'] = array();
$query_args['meta_query'][] = $woocommerce->query->stock_status_meta_query();
$query_args['meta_query'][] = $woocommerce->query->visibility_meta_query();
/**********END QUERY FOR TOP-RATED PRODUCT**********/