<?php

if ($display_rating === 'yes' && get_option( 'woocommerce_enable_review_rating' ) !== 'no') {
	$product = calla_elated_return_woocommerce_global_variable();
	$average = $product->get_average_rating();
	?>
	<?php if ($average > 0){?>
	<div class="eltdf-<?php echo esc_attr($class_name); ?>-rating-holder">
		<div class="eltdf-<?php echo esc_attr($class_name); ?>-rating" title="<?php sprintf(esc_attr_e("Rated %s out of 5", "calla"), $average ); ?>">
            <span style="width: <?php echo esc_attr( ( $average / 5 ) * 100 ) . '%'; ?>"></span>
		</div>
	</div>
    <?php }?>
<?php } ?>