Automattic\WooCommerce\Admin\API\Reports\Categories

Controller::prepare_item_for_export()publicWC 1.0

Get the column values for export.

Method of the class: Controller{}

Return

Array. Key value pair of Column ID => Row Value.

Usage

$Controller = new Controller();
$Controller->prepare_item_for_export( $item );
$item(array) (required)
Single report item/row.

Controller::prepare_item_for_export() code WC 8.6.1

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
	);
}