sync_rating_count before average in deprecated method
This commit is contained in:
parent
a2606a3f1f
commit
6d5f5be164
|
@ -653,6 +653,7 @@ abstract class WC_Abstract_Legacy_Product extends WC_Data {
|
|||
*/
|
||||
public static function sync_average_rating( $post_id ) {
|
||||
wc_deprecated_function( 'WC_Product::sync_average_rating', '3.0', 'WC_Comments::get_average_rating_for_product or leave to CRUD.' );
|
||||
self::sync_rating_count( $post_id );
|
||||
$average = WC_Comments::get_average_rating_for_product( wc_get_product( $post_id ) );
|
||||
update_post_meta( $post_id, '_wc_average_rating', $average );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue