Retrieving Tag Name in Template Part from Filtered URL

Not sure if I’m understanding you correctly, but why don’t you just use $_GET[‘product_tag’] at the moment where you want to retrieve it?

UPDATE

If the product posts exist in the basic wp_{custom}_posts database or similar, this solution of a basic WP post query method may be more convenient to you:

$args = array(
  'post_type' => 'product_post_type',
  'name' => 'your_post_slug',
);

$arr_posts = new WP_Query($args);

if ($arr_posts->have_posts()) {
  while ($arr_posts->have_posts()) {
    echo $arr_posts->the_post();
      the_title();
      }
    } else {
    echo "<p class="error">No posts with this slug found!<p>";
    }

This example queries in the database mentioned above for posts of the specified type and slug name and echoes out their title. You can also further specify query paramaters, as post tag names, category names, and so on, in the $args array. Also, the post type is not a must, just thought it’s probably also unique to product posts if they’re stored in the same database.

Just found this https://wp-staging.com/in-which-database-table-is-woocommerce-storing-products/, so the code above should definitely work.