Automattic\WooCommerce\Internal\Admin\Notes

OrderMilestones::get_orders_count()publicWC 1.0

Get the total count of orders (in the allowed statuses).

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

Хуков нет.

Возвращает

int. Total orders count.

Использование

$OrderMilestones = new OrderMilestones();
$OrderMilestones->get_orders_count( $no_cache );
$no_cache(true|false)
Skip cache.
По умолчанию: false

Код OrderMilestones::get_orders_count() WC 9.4.2

public function get_orders_count( $no_cache = false ) {
	if ( $no_cache || is_null( $this->orders_count ) ) {
		$status_counts      = array_map( 'wc_orders_count', $this->allowed_statuses );
		$this->orders_count = array_sum( $status_counts );
	}

	return $this->orders_count;
}