WC_Product::get_review_count PHP Method

get_review_count() public method

Get review count.
public get_review_count ( string $context = 'view' ) : integer
$context string
return integer
    public function get_review_count($context = 'view')
    {
        return $this->get_prop('review_count', $context);
    }

Usage Example

 /**
  * Update a products review count meta.
  *
  * @since 2.7.0
  * @param WC_Product $product
  */
 public function update_review_count($product)
 {
     update_post_meta($product->get_id(), '_wc_review_count', $product->get_review_count('edit'));
 }
WC_Product