Hi Anh Tran,
Thanks for your help. I think I was over complicating things.
Realised we don't need to get the terms, only the taxonomies so this is our working example and now the user has access to custom meta boxes when they add/edit colors, sizes or whatever product attribute(s) they use.
$taxonomy_names = array( 'category', 'post_tag', 'product_cat', 'product_tag' );
if ( class_exists( 'WooCommerce' ) ) {
$taxonomy_names_wc = wc_get_attribute_taxonomy_names();
if ( $taxonomy_names_wc ) {
$taxonomy_names = array_merge( $taxonomy_names, $taxonomy_names_wc );
}
}
$meta_boxes[] = array(
'taxonomies' => $taxonomy_names,