unable to get product by category only getting product added lastly

Try this code.

<?php 


if(isset($_POST['step_03'])) {
    $que_01 = $_POST['que_01'];
    $que_02 = $_POST['que_02'];
    $que_03 = $_POST['que_03'];
    $subcat = array("$que_01", "$que_02", "$que_03");

    $args = array( 
        'post_type'      => 'product', 
        'posts_per_page' => -1, 
        'product_tag'    => $que_01 
    );
} else {
    if(isset($_POST['cat'])) {
        $tags = $_POST['cat'];
    }
    $args = array( 
        'post_type'      => 'product', 
        'posts_per_page' =>  -1, 
        'product_category'   => $tags 
    );
}
$loop = new WP_Query( $args );
$product_count = $loop->post_count;
if( $product_count > 0 ) :
    while ( $loop->have_posts() ) : $loop->the_post(); 
        global $post;
        echo $thePostID = $loop->post->post_title;
            }
endif;


?>