Title: Simple Product Attribute Description
Last modified: November 30, 2018

---

# Simple Product Attribute Description

 *  Resolved [inkform](https://wordpress.org/support/users/inkform/)
 * (@inkform)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/simple-product-attribute-description/)
 * I have a few custom attributes like “age” and “level” on for my simple products.
   These display just fine with the following code. However, I would like to include
   the description as well. For instance, if the Level is “Starter” then the it 
   might show as LEVEL: Starter (description here). Any help? Thank you.
 * <?php foreach ( $attributes as $attribute ) : ?>
 *  <div class=”ts-attribute”>
    **<?php echo wc_attribute_label( $attribute->get_name());?
   >: ** <?php $values = array();
 *  if ( $attribute->is_taxonomy() ) {
    $attribute_taxonomy = $attribute->get_taxonomy_object();
   $attribute_values = wc_get_product_terms( $product->get_id(), $attribute->get_name(),
   array( ‘fields’ => ‘all’ ) );
 *  foreach ( $attribute_values as $attribute_value ) {
    $value_name = esc_html(
   $attribute_value->name );
 *  if ( $attribute_taxonomy->attribute_public ) {
    $values[] = ‘term_id, $attribute-
   >get_name() ) ) . ‘” rel=”tag”>’ . $value_name . ‘
   ‘;
    } else { $values[] = $
   value_name; } } } else { $values = $attribute->get_options();
 *  foreach ( $values as &$value ) {
    $value = make_clickable( esc_html( $value ));}}
 *  echo apply_filters( ‘woocommerce_attribute’, wptexturize( implode( ‘, ‘, $values)),
   $attribute, $values );
    ?> </div>
 *  <?php endforeach; ?>

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Contributor [James Koster](https://wordpress.org/support/users/jameskoster/)
 * (@jameskoster)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/simple-product-attribute-description/#post-10945333)
 * Hi there,
 * You’re assigning the attribute name to a variable here;
 * `$value_name = esc_html( $attribute_value->name );`
 * You can do the same with the description;
 * `$value_description = esc_html( $attribute_value->description );`
 * You can then use that variable to display the description as required.
 * Also see the answer over [here](https://stackoverflow.com/questions/32774652/woocommerce-how-to-show-attribute-variation-description)
   for an alternative solution.
 * James
    Designer @ Automattic
 *  Thread Starter [inkform](https://wordpress.org/support/users/inkform/)
 * (@inkform)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/simple-product-attribute-description/#post-10945534)
 * That is fantastic! Works great. Thank you so much for the help.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Simple Product Attribute Description’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [inkform](https://wordpress.org/support/users/inkform/)
 * Last activity: [7 years, 7 months ago](https://wordpress.org/support/topic/simple-product-attribute-description/#post-10945534)
 * Status: resolved