Automattic\WooCommerce\Admin\API\Reports\Categories
Controller::prepare_item_for_export
Get the column values for export.
Method of the class: Controller{}
Hooks from the method
Returns
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() Controller::prepare item for export code WC 11.2.2
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
);
}