Automattic\WooCommerce\Admin\API\Reports\Revenue\Stats

Controller::get_item_properties_schemaprotectedWC 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 10.3.4

protected function get_item_properties_schema() {
	return array(
		'total_sales'    => array(
			'description' => __( 'Total sales.', 'woocommerce' ),
			'type'        => 'number',
			'context'     => array( 'view', 'edit' ),
			'readonly'    => true,
			'indicator'   => true,
			'format'      => 'currency',
		),
		'net_revenue'    => array(
			'description' => __( 'Net sales.', 'woocommerce' ),
			'type'        => 'number',
			'context'     => array( 'view', 'edit' ),
			'readonly'    => true,
			'indicator'   => true,
			'format'      => 'currency',
		),
		'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,
			'format'      => 'currency',
		),
		'shipping'       => array(
			'title'       => __( 'Shipping', 'woocommerce' ),
			'description' => __( 'Total of shipping.', 'woocommerce' ),
			'type'        => 'number',
			'context'     => array( 'view', 'edit' ),
			'readonly'    => true,
			'indicator'   => true,
			'format'      => 'currency',
		),
		'taxes'          => array(
			'description' => __( 'Total of taxes.', 'woocommerce' ),
			'type'        => 'number',
			'context'     => array( 'view', 'edit' ),
			'readonly'    => true,
			'format'      => 'currency',
		),
		'refunds'        => array(
			'title'       => __( 'Returns', 'woocommerce' ),
			'description' => __( 'Total of returns.', 'woocommerce' ),
			'type'        => 'number',
			'context'     => array( 'view', 'edit' ),
			'readonly'    => true,
			'indicator'   => true,
			'format'      => 'currency',
		),
		'orders_count'   => array(
			'description' => __( 'Number of orders.', 'woocommerce' ),
			'type'        => 'integer',
			'context'     => array( 'view', 'edit' ),
			'readonly'    => true,
		),
		'num_items_sold' => array(
			'description' => __( 'Items sold.', 'woocommerce' ),
			'type'        => 'integer',
			'context'     => array( 'view', 'edit' ),
			'readonly'    => true,
		),
		'gross_sales'    => array(
			'description' => __( 'Gross sales.', 'woocommerce' ),
			'type'        => 'number',
			'context'     => array( 'view', 'edit' ),
			'readonly'    => true,
			'indicator'   => true,
			'format'      => 'currency',
		),
	);
}