Automattic\WooCommerce\Admin\API\Reports\Orders\Stats

Controller::get_item_properties_schema()protectedWC 1.0

Get the Report's item properties schema. Will be used by get_item_schema as totals and subtotals.

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

Хуков нет.

Возвращает

Массив.

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->get_item_properties_schema();

Код Controller::get_item_properties_schema() WC 9.4.2

protected function get_item_properties_schema() {
	return array(
		'net_revenue'         => array(
			'description' => __( 'Net sales.', 'woocommerce' ),
			'type'        => 'number',
			'context'     => array( 'view', 'edit' ),
			'readonly'    => true,
			'format'      => 'currency',
		),
		'orders_count'        => array(
			'title'       => __( 'Orders', 'woocommerce' ),
			'description' => __( 'Number of orders', 'woocommerce' ),
			'type'        => 'integer',
			'context'     => array( 'view', 'edit' ),
			'readonly'    => true,
			'indicator'   => true,
		),
		'avg_order_value'     => array(
			'description' => __( 'Average order value.', 'woocommerce' ),
			'type'        => 'number',
			'context'     => array( 'view', 'edit' ),
			'readonly'    => true,
			'indicator'   => true,
			'format'      => 'currency',
		),
		'avg_items_per_order' => array(
			'description' => __( 'Average items per order', 'woocommerce' ),
			'type'        => 'number',
			'context'     => array( 'view', 'edit' ),
			'readonly'    => true,
		),
		'num_items_sold'      => array(
			'description' => __( 'Number of items sold', 'woocommerce' ),
			'type'        => 'integer',
			'context'     => array( 'view', 'edit' ),
			'readonly'    => true,
		),
		'coupons'             => array(
			'description' => __( 'Amount discounted by coupons.', 'woocommerce' ),
			'type'        => 'number',
			'context'     => array( 'view', 'edit' ),
			'readonly'    => true,
		),
		'coupons_count'       => array(
			'description' => __( 'Unique coupons count.', 'woocommerce' ),
			'type'        => 'number',
			'context'     => array( 'view', 'edit' ),
			'readonly'    => true,
		),
		'total_customers'     => array(
			'description' => __( 'Total distinct customers.', 'woocommerce' ),
			'type'        => 'integer',
			'context'     => array( 'view', 'edit' ),
			'readonly'    => true,
		),
		'products'            => array(
			'description' => __( 'Number of distinct products sold.', 'woocommerce' ),
			'type'        => 'number',
			'context'     => array( 'view', 'edit' ),
			'readonly'    => true,
		),
	);
}