mydog8it, I am interested in the same answer. What is the link to your site? My site is foryourcue.com
mydog8it, John Hager, I don’t know if you are still looking for a solution but in case anyone else needs one here is mine:
if ( taxonomy_exists( sanitize_title( $name ) ) ) {
$terms = get_terms( sanitize_title($name), array('menu_order' => 'ASC') );
foreach ( $terms as $term ) {
if ( ! in_array( $term->slug, $options ) ) continue;
echo '<input type="radio" value="' . strtolower($term->slug) . '" ' . checked( strtolower ($selected_value), strtolower ($term->slug), false ) . ' id="'. esc_attr( sanitize_title($name) ) .'" name="attribute_'. sanitize_title($name).'">' . apply_filters( 'woocommerce_variation_option_name', $term->name ).'<br />';
echo '<div class="plans-description">' . strtolower($term->description) . '</div><br />';//this is the line you need to add to show the description. I wrapped it in a div.
}
} else {
foreach ( $options as $option )
echo '<input type="radio" value="' .strtolower($option) . '" ' . checked( strtolower ($selected_value), strtolower ($option), false ) . ' id="'. esc_attr( sanitize_title($name) ) .'" name="attribute_'. sanitize_title($name).'">' . apply_filters( 'woocommerce_variation_option_name', $option ) . '<br />';
echo '<div class="plans-description">' . strtolower($term->description) . '</div><br />';//this is the line you need to add to show the description. I wrapped it in a div.
}
Have in mind I am using the “Woo Radio Buttons” plugin.So I don’t know how this handles with the default select, but it’s a start
This only shows the description if it exists:
$term_desc = strtolower($term->description);
if ( '' !== $term_desc ){
echo "<div class='plans-description'>$term_desc</div><br />";
}
Thanks rhristova. I’ll give it a try and let you know if it works without the plugin.
hi, rhristova…
where should I put your php code to make it work?
I can not get it to work … can anyone tell me which php file and put this code in that line?