Title: Display Woocommerce Product Attribute Term Description on product page
Tags: wordpress;woocommerce
Question: In WooCommerce under Products > Attributes > [Name of Attribute] > Add New [Attribute Variation] there is a section titled "Description" with the text "The description is not prominent by default; however, some themes may show it."
I would like to display this on the Product Page, underneath the attribute dropdown
This is how I want it to look:
And this is where the code should go I assume:
<?php foreach ( $attributes as $attribute_name =&gt; $options ) : ?&gt;
<tr&gt;
<td class="label"&gt;<label for="<?php echo sanitize_title( $attribute_name ); ?&gt;"&gt;<?php echo wc_attribute_label( $attribute_name ); ?&gt;</label&gt;</td&gt;
<td class="value"&gt;
<?php
$selected = isset( $_REQUEST[ 'attribute_' . sanitize_title( $attribute_name ) ] ) ? wc_clean( $_REQUEST[ 'attribute_' . sanitize_title( $attribute_name ) ] ) : $product-&gt;get_variation_default_attribute( $attribute_name );
wc_dropdown_variation_attribute_options( array( 'options' =&gt; $options, 'attribute' =&gt; $attribute_name, 'product' =&gt; $product, 'selected' =&gt; $selected ) );
?&gt;
</td&gt;
</tr&gt;
<?php endforeach;?&gt;
Someone has asked something similar on here but I can't see how to amend it to display on the product page.
$values = wc_get_product_terms( $product-&gt;id, $attribute['name'], array( 'fields' =&gt;  'all' ) );
if( $values ){
echo '<dl&gt;';
foreach ( $values as $term ){
echo '<dh&gt;' . $term-&gt;name.' </dh&gt;';
echo '<dd&gt;' . term_description( $term-&gt;term_id, $term-&gt;taxonomy ) . '</dd&gt;';
}
echo '</dl&gt;';
Thank you


Here is another answer: As specified here - term_description you can use term_description() to get the description of a term of choice.
The function accepts two parameters, one being the id of the tag and the other the slug of the term you want to get the description for. If no term ID is passed, the description of current queried term will be returned.
The function works inside the product-attributes.php file.

Here is another answer: try to get attribute value with single attribute name.
$values = wc_get_product_terms( $product-&gt;id, 'test_attributename', array( 'fields' =&gt;  'all' ) );
if( $values ){
echo '<dl&gt;';
foreach ( $values as $term ){
echo '<dh&gt;' . $term-&gt;name.' </dh&gt;';
echo '<dd&gt;' . term_description( $term-&gt;term_id, $term-&gt;taxonomy ) . '</dd&gt;';
}
echo '</dl&gt;';
Comment for this answer: Hi, thanks for your reply. But unless I'm adding this into the wrong place entirely, it's not showing anything.

{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 2, 'CommentCount': 0, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2018:00:01/23/18', 'FavoriteCount': 1.0, 'PostTypeId': 1, 'Tags': '<wordpress><woocommerce>', 'Title': 'Display Woocommerce Product Attribute Term Description on product page', 'ViewCount': 6450, 'id': 48407457, 'user_AboutMe': None, 'user_AccountId': 12794409.0, 'user_DisplayName': 'Kim Usher', 'user_Reputation': 31.0, 'user_Views': 11.0, 'user_id': 9257897.0}}