WooCommerce

Display Reviews Count next to Star Rating in Woocommerce

In WooCommerce, the star rating system is a built-in feature that allows customers to rate products on your website. However, by default, the rating count (the number of ratings a product has received) is not displayed next to the star rating. In this article, we will show you how to display the reviews count next to the star rating in WooCommerce without using a plugin.

Why should display reviews count?

Displaying the reviews count next to the star rating in WooCommerce can be a powerful way to influence customer purchasing decisions and improve the overall user experience on your website. Here are a few reasons why it’s important to display the reviews count next to the star rating in WooCommerce.

First, displaying the reviews count next to the star rating can provide valuable information to customers. By seeing the number of reviewss a product has received, customers can get a better sense of how popular or well-reviewed a product is. This can help them to make more informed purchasing decisions and feel more confident in their choice. Additionally, the reviews count can also act as a form of social proof, showing customers that other people have purchased and been satisfied with the product.

Second, displaying the reviews count next to the star rating can also help to increase user engagement on your website. When customers are able to see the number of reviews a product has received, they may be more inclined to leave a rating themselves. This can help to create a sense of community on your website and encourage customers to spend more time browsing your products.

Third, displaying the reviews count can also help to improve your website’s search engine rankings. Search engines like Google take into account user engagement and social proof when ranking websites. By displaying the reviews count, you can signal to search engines that your website is popular and well-reviewed, which can help to improve your rankings.

More Articles:
Move Woocommerce Reviews Tab before Description.
Display Woocommerce Product Reviews outside of Tab.
Add Buy Now Button in WooCommerce Without Plugin.

Video Tutorial [Hindi Language]

best woocommerce theme 2023

Steps to display reviews count

Please note that it is important to do this customization in a child theme. If you have not yet created child theme then follow this tutorial to create one.

1) Create necessary Folders.

You need to access the file manager of your website. For example, here i am using Control Panel to access the file manager. Below is the image for your reference.

display reviews count next to star rating in woocommerce loop pages
display reviews count next to star rating in woocommerce loop pages 2

Image explanation:

1. Go to control panel and login.

2. Go to search bar and search for File Manager.

3. Open the file manager and choose the folder in the left side where you have saved your website. In my case, my website folder is in public_html.

4. Select your website folder. It is bassicly named as your website domain. In my case, woo.wpamit.com is the domain of my website so i am selecting woo.wpamit.com folder.

5. Open wp-content folder.

6. Open themes folder.

7. Open your currently active theme’s folder.

8. Now create a new folder in your currently active theme’s folder.

9. Name the folder as woocommerce.

10. Open newly created folder woocommerce and again create a new folder in woocommerce folder. Name this new folder as loop.

2) Create rating.php file.

It’s time to create the rating.php file in loop folder which we have created in previous step. Below image is for your reference.

display reviews count next to star rating in woocommerce loop pages 3

Image Explanation:

1. Once you are in your newly created folder (loop), create a file.

2. Name the file as rating.php.

3. Right click on the newly created rating.php file then click on Edit.

4. A warning popup will appear. Click on Edit.

3) Add below code in rating.php file.

Copy the below code and paste it in rating.php file which we have created in previous step.

<?php
/**
 * Loop Rating
 *
 * This template can be overridden by copying it to yourtheme/woocommerce/loop/rating.php.
 *
 * HOWEVER, on occasion WooCommerce will need to update template files and you
 * (the theme developer) will need to copy the new files to your theme to
 * maintain compatibility. We try to do this as little as possible, but it does
 * happen. When this occurs the version of the template file will be bumped and
 * the readme will list any important changes.
 *
 * @see         http://wpamit.com/
 * @author      wpamit
 * @package     WooCommerce/Templates
 * @version     3.6.0
 */

if ( ! defined( 'ABSPATH' ) ) {
    exit;
}

global $product;

if ( ! wc_review_ratings_enabled() ) {
	return;
}

$rating_count = $product->get_rating_count();
$review_count = $product->get_review_count();
$average      = $product->get_average_rating();

if ( $rating_count >= 1 ) : ?>

            <?php echo wc_get_rating_html($average, $rating_count); ?>
        <?php if ( comments_open() ): ?><a href="<?php echo get_permalink() ?>#reviews" class="woocommerce-review-link" rel="nofollow">(<?php printf( _n( '%s',$review_count,'woocommerce' ), '<span class="count">' . esc_html( $review_count ) . '</span>' ); ?>)</a><?php endif ?>


<?php endif; ?>

After pasting the above code, click on Save File.

It’s done! Now you will see the reviews count next to star rating in woocommerce without plugin.

Leave a Reply

Your email address will not be published. Required fields are marked *