Support » Plugin: Photo Reviews for WooCommerce » Display empty star rating

  • Hello Guys,

    We love your plug in but we would like to display star rating when there is 0 review as well. Because we would like to align button below the star rating.

    Please advise how to show empty start when there is no review.

    Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support mivtt

    (@mivtt)

    Hi,

    I am not sure about your need, can you describe specifically? Currently, if there is no review, it shows like this: https://prnt.sc/1ubpecw please clarify what you want by screenshot and describe on it.

    Best regards.

    Thread Starter eundoong

    (@eundoong)

    Hello,

    Thanks for getting back to me.

    https://prnt.sc/1x8lnsf

    Some of my client’s products have reviews and some don’t. That makes our ‘select options'(add to cart) buttons not aligned vertically. I would like to display empty stars so although some products don’t have reviews, buttons could sitting at the same level.

    Can you please help to achieve this? or let me know another way to do this?

    Thank you.

    Plugin Support mivtt

    (@mivtt)

    Hi,

    In this case, please try to use this custom CSS, add this in Reviews tab > Custom CSS:

    add_filter('woocommerce_product_get_rating_html',function ( $html, $rating, $count){
    	$label = sprintf( __( 'Rated %s out of 5', 'woocommerce' ), $rating );
    	$html  ='<div class="star-rating" role="img" aria-label="' . esc_attr( $label ) . '">' . wc_get_star_rating_html( $rating, $count ) . '</div>';
    	return $html;
    },9999,3);

    Best regards.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.