• Resolved RandomDude

    (@gazuots)


    Hello,
    Is it possible to modify code you posted in this topic

    add_filter( 'woocommerce_product_get_rating_html', function ( $html, $rating, $count ) {
    	global $product;
    	if ( $html && is_archive() && $product) {
    		$html .= sprintf( '<div class="gkartikey-product-rating-count">(%s)</div>', $product->get_rating_count() );
    	}
    
    	return $html;
    }, 10, 3 );

    It works only in archive, how to add rating count to all other product places like front page etc.?
    Thank you

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

    (@mivtt)

    Hi,

    We are sorry for the late reply.

    Please use this code snippet below:

    add_filter( 'woocommerce_product_get_rating_html', function ( $html, $rating, $count ) {
    	global $product;
    	if ( $html  && $product) {
    		$html .= sprintf( '<div class="gkartikey-product-rating-count">(%s)</div>', $product->get_rating_count() );
    	}
    
    	return $html;
    }, 10, 3 );

    Best regards.

    Thread Starter RandomDude

    (@gazuots)

    Already did it, but thanks for response anyway

    Plugin Support mivtt

    (@mivtt)

    Thank you for confirming this for us.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Add Count of the number of reviews alongside Star Rating’ is closed to new replies.