Should pass WC_Product instancies to WC_Comments methods (#12327)

This commit is contained in:
Claudio Sanches 2016-11-11 16:13:56 -02:00 committed by Mike Jolley
parent bc9d2c72aa
commit 096622c9e4
1 changed files with 3 additions and 3 deletions

View File

@ -163,15 +163,15 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_CPT implements WC_Object_D
$average_rating = get_post_meta( $id, '_wc_average_rating', true );
if ( '' === $review_count ) {
$review_count = WC_Comments::get_review_count_for_product( $this );
$review_count = WC_Comments::get_review_count_for_product( $product );
}
if ( '' === $rating_counts ) {
$rating_counts = WC_Comments::get_rating_counts_for_product( $this );
$rating_counts = WC_Comments::get_rating_counts_for_product( $product );
}
if ( '' === $average_rating ) {
$average_rating = WC_Comments::get_average_rating_for_product( $this );
$average_rating = WC_Comments::get_average_rating_for_product( $product );
}
$product->set_average_rating( $average_rating );