Those classes are generated by the WordPress post_class()
function as seen in the content-product.php
template:
<li <?php post_class( $classes ); ?>>
There's a good example in the Codex on how to add categories to the post class. Modifying that a bit for product categories we have:
// add product category name to post class
function category_id_class( $classes ) {
global $post;
$product_cats = get_the_terms( $post->ID, 'product_cat' );
if( $product_cats ) foreach ( $product_cats as $category ) {
$classes[] = $category->name;
}
return $classes;
}
add_filter( 'post_class', 'category_id_class' );