Quantcast
Channel: WordPress.org Forums » [WooCommerce] Support
Viewing all articles
Browse latest Browse all 102102

rhristova on "[Plugin: WooCommerce - excelling eCommerce] Product Attribute Variation Description"

$
0
0

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


Viewing all articles
Browse latest Browse all 102102

Trending Articles