WordPress at Your Fingertips
function is not described

WC_Product::set_average_rating() public WC 1.0

Set average rating. Read only.

{} It's a method of the class: WC_Product{}

No Hooks.

Return

null. Nothing.

Usage

$WC_Product = new WC_Product();
$WC_Product->set_average_rating( $average );
$average(float) (required)
Product average rating.

Code of WC_Product::set_average_rating() WC 5.5.2

<?php
public function set_average_rating( $average ) {
	$this->set_prop( 'average_rating', wc_format_decimal( $average ) );
}