jmccole83
2/28/2018 - 10:52 AM

WooCommerce | List all product tags in archive pages

Add the below snippet to functions.php to output the associated tags with a product in the archive pages. Update as neccessary.

add_action( 'woocommerce_after_shop_loop_item', 'woocommerce_product_loop_tags', 5 );

function woocommerce_product_loop_tags() {
    global $post, $product;

    $tag_count = sizeof( get_the_terms( $post->ID, 'product_tag' ) );

    echo $product->get_tags( ', ', '<span class="tagged_as">' . _n( 'Tag:', 'Tags:', $tag_count, 'woocommerce' ) . ' ', '.</span>' );
}