How to get the unique tags of the posts under a category in wordpress?

You achieve all unique tags according to the product category. Just add this code in functions.php and use this hook where you want to display it.

do_action( ‘archive_tag_filters_action’);

function archive_tag_filters_callback() {
$category = get_queried_object();
$args = array(
    'post_type'             => 'product',
    'post_status'           => 'publish',
    'posts_per_page'        => '-1',
    'tax_query'             => array(
        array(
            'taxonomy'      => 'product_cat',
            'field'         => 'id', 
            'terms'         =>  $category->term_id, //category id
            'operator'      => 'IN' 
        )
    )
);
$query = new WP_Query( $args );
$term_array = $tags_unique  = array();
while( $query->have_posts() ) {
      $query->the_post();
      $terms = get_the_terms( get_the_ID(), 'product_tag' );
      if ( ! empty( $terms ) && ! is_wp_error( $terms ) ){
            foreach ( $terms as $term ) {
                 $term_array[] = array(
                    'term_text' => $term->name,
                    "term_link" => get_term_link( $term )
                 );
             }
      }
}
foreach ($term_array as $row) {
    $tags_unique[$row['term_text']] = $row;
}
$current_tags = array_values($tags_unique);
if ( $current_tags ) {
    echo '<ul>';
    foreach ( $current_tags as $term ) {
    echo '<li>';
       echo '<a href="' . $term['term_link'] . '">';
           echo $term['term_text'];
       echo '</a>';
    echo '</li>';
}
    echo '</ul>';
}
else{
    echo '<ul>';
       echo '<li>No results.</li>';
    echo '</ul>';
}
}
add_action( 'archive_tag_filters_action', 'archive_tag_filters_callback', 10, 2 );