Book Image

WooCommerce Cookbook

By : Patrick Rauland
Book Image

WooCommerce Cookbook

By: Patrick Rauland

Overview of this book

Table of Contents (17 chapters)
WooCommerce Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Hiding reviews from the Category/Shop page


You may like the idea of reviews but also have a few angry customers who are lowering the average rating of your product. You don't want that to impact future customers. One solution is to hide the average rating on the shop page and only show ratings on the product page, where users will be able to read the content of the review in addition to the actual star rating. That will help them understand exactly why someone doesn't like the product and the reason may not even affect them, so you could still get the sale.

How to do it...

If you look at the shop page right now, it will display a star rating based on an average of all of the reviews, as shown in following screenshot:

The star rating is added to the page with an action attached to a hook. We're going to use the hook system to remove that action. Let's take a look at the following steps:

  1. Open up your theme's functions.php file or a custom WooCommerce plugin.

  2. Add the following code to the bottom...