Automattic\WooCommerce\Internal\Admin

CustomerEffortScoreTracks::get_shop_order_count()privateWC 1.0

Get the current shop order count.

Метод класса: CustomerEffortScoreTracks{}

No Hooks.

Return

Int. The current shop order count.

Usage

// private - for code of main (parent) class only
$result = $this->get_shop_order_count();

Code of CustomerEffortScoreTracks::get_shop_order_count() WC 7.1.0

private function get_shop_order_count() {
	$query            = new \WC_Order_Query(
		array(
			'limit'    => 1,
			'paginate' => true,
			'return'   => 'ids',
		)
	);
	$shop_orders      = $query->get_orders();
	$shop_order_count = intval( $shop_orders->total );

	return $shop_order_count;
}