if ( $product->is_type('variable') ) {
foreach ( $product->get_available_variations() as $variation ) {
foreach ( wc_get_product($variation['variation_id'])->get_variation_attributes() as $attr ) {
echo wc_attribute_label( $attr );
}
$active_price = floatval($variation['display_price']);
$regular_price = floatval($variation['display_regular_price']);
if ( $active_price != $regular_price ){
$sale_price = $active_price;
}
echo '<span class="variation-prices"><strong>Price</strong>: '.$variation['price_html'].'</span><br>';
}
}