forked from woocommerce/woocommerce
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix average product rating when ratings are not required
If ratings are not required, the total rating count was counting all reviews which skewed the average rating. In other words, reviews with no rating were counted as a “zero” rating in the average rating calculation. This bug was introduced in 83a457b which provided a fix for woocommerce#6839. This change introduces a new product method `get_review_count()` which can be used to accurately calculate the total number of reviews for a product. Some instances of `get_rating_count()` were replaced with `get_review_count()` where appropriate. Additionally, the `single-product/rating.php` template was adjusted to display the correct number of customer reviews and ratings in rich snippets. I’ve also included the `bestRating` rich snippet detailed [here](http://schema.org/AggregateRating). The version number was adjusted to 2.3.2 on that template as I think this is a larger change.
- Loading branch information
Showing
5 changed files
with
47 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters