This code is from the archive page and list all products with a certain tag, can someone please help me to modify this code to make listing products only from current category:
<?php if ( is_product_tag() ) :?>
<?php do_action('woocommerce_before_shop_loop'); ?>
<ul class="products">
<?php while ( have_posts() ) : the_post(); ?>
<?php woocommerce_get_template_part( 'content', 'product'); ?>
<?php endwhile; // end of the loop. ?>
</ul>
<?php do_action('woocommerce_after_shop_loop'); ?>
<?php endif; ?>