// seřazení produktů dle zařazení subkategorií
function woocommerce_get_product_category_of_subcategories( $category_slug ){
$terms_html = array();
$taxonomy = 'product_cat';
$parent = get_term_by( 'slug', $category_slug, $taxonomy );
$children_ids = get_term_children( $parent->term_id, $taxonomy );
foreach($children_ids as $children_id){
$term = get_term( $children_id, $taxonomy );
$term_link = get_term_link( $term, $taxonomy );
if ( is_wp_error( $term_link ) ) $term_link = '';
$terms_html[] = '' . $term->name . '';
}
return '' . implode( ', ', $terms_html ) . '';
}