I am trying to add empty star rating to those products which don't have any rating. I am using the below code for this purpose. `
add_action('woocommerce_after_shop_loop_item_title', 'get_star_rating' );
function get_star_rating()
{
global $woocommerce, $product;
$rating_count = $product->get_rating_count();
if ($rating_count == 0){
$rating_html = '</a><a href="' . get_the_permalink() . '#respond"><div class="star-rating"><span style="width:' . (( $rating / 5 ) * 100) . '%"></span></div><span class="woocommerce-review-link"></span></a>';
echo $rating_html;
}
}
The problem with the above code is that it shows empty stars after price and the products which have rating show stars above price.

I want that empty stars must show above the price. Anyone please guide me how can I achive that?