Automattic\WooCommerce\Admin\API\Reports\Categories

Controller::prepare_item_for_export()publicWC 1.0

Get the column values for export.

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

Возвращает

Массив. Key value pair of Column ID => Row Value.

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

$Controller = new Controller();
$Controller->prepare_item_for_export( $item );
$item(массив) (обязательный)
Single report item/row.

Код Controller::prepare_item_for_export() WC 9.3.3

public function prepare_item_for_export( $item ) {
	$export_item = array(
		'category'       => $item['extended_info']['name'],
		'items_sold'     => $item['items_sold'],
		'net_revenue'    => $item['net_revenue'],
		'products_count' => $item['products_count'],
		'orders_count'   => $item['orders_count'],
	);

	/**
	 * Filter to prepare extra columns in the export item for the
	 * categories export.
	 *
	 * @since 1.6.0
	 */
	return apply_filters(
		'woocommerce_report_categories_prepare_export_item',
		$export_item,
		$item
	);
}