I have researched this all day but cant seem to get a straight answer how can I get the set product attributes along with the configured terms for each?
This is what I have now
//get the terms
$attribute_taxonomies = wc_get_attribute_taxonomies();
$taxonomy_terms = array();
if ( $attribute_taxonomies ) {
foreach ($attribute_taxonomies as $tax) {
//dont know what to add here
}
}
var_dump($taxonomy_terms);
2
Answers
Here below you will get a list of all product attributes and their respective term names:
If you prefer to get an array of the WP_terms objects, you will use:
That will allow use a foreach loop to get what you want from each term…
First check the wc_get_attribute_taxonomies() function with var_dump().