• Hello everyone! I need some help/guidance on a site I’m working on.

    SETUP:
    -Woo-commerce plugin
    -Quickview plugin
    -Divi theme using ‘shop modal’

    Issue one: I’m a perfectionist and it bugs me that nothing shows unless a review is actually left. I need a way to display an empty star rating or a string “no reviews yet” so everything looks correct.

    Issue two: How can I move the 1,2> that lets you go to more pages within the shop modal. As well as do away with the drop down that lets you sort as I don’t need that.

    Thank you for the help!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Ad.1 Maybe this code help. I’m using this and works for me.

    	// Woocommerce rating stars always
    	add_filter('woocommerce_product_get_rating_html', 'your_get_rating_html', 10, 2);
    
    	function your_get_rating_html($rating_html, $rating) {
      	if ( $rating > 0 ) {
        	$title = sprintf( __( 'Rated %s out of 5', 'woocommerce' ), $rating );
      	} else {
        	$title = 'Not yet rated';
        	$rating = 0;
      	}
    
      	$rating_html  = '<div class="star-rating" title="' . $title . '">';
      	$rating_html .= '<span style="width:' . ( ( $rating / 5 ) * 100 ) . '%"><strong class="rating">' . $rating . '</strong> ' . __( 'out of 5', 'woocommerce' ) . '</span>';
      	$rating_html .= '</div>';
      	return $rating_html;
    	}
    Thread Starter kbachand

    (@kbachand)

    Issue
    THANK you for that code! It worked. I attached a picture of the second issue I’m having which is the 1,2 and the “sort product by”. It needs to be moved up above vegan, non-gmo, etc…But not sure where to access that to move it. I could actually do away with the “sort by dropdown”.

    • This reply was modified 8 years, 4 months ago by kbachand. Reason: image sideways
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to display empty star ratings/not rated yet’ is closed to new replies.