public function update_average_rating($product) { update_post_meta($product->get_id(), '_wc_average_rating', $product->get_average_rating('edit')); }