As we know, to get terms of specific attribute added to a product we can use:
$attr_terms = $product->get_attribute( 'attr_slug' );
OR to get all terms of specific attribute regardless of a product we can use
$attr_terms = get_terms( 'pa_attr_slug' );
But how to get all attributes with their terms added to products of specific product category?
Something like:
$cat_attrs = ... ($cat->id);
foreach($cat_attrs as $cat_attr) {
echo $cat_attr->name; // name of attribute
foreach($cat_attr->terms as $term) {
echo $term->name; // name of attribute term
}
}