* Filter to add or remove column names from the stock report for
'woocommerce_report_stock_export_columns',
* Get the column values for export.
* @param array $item Single report item/row.
* @return array Key value pair of Column ID => Row Value.
public function prepare_item_for_export( $item ) {
$status = $item['stock_status'];
if ( array_key_exists( $item['stock_status'], $this->status_options ) ) {
$status = $this->status_options[ $item['stock_status'] ];
'title' => $item['name'],
'stock_status' => $status,
'stock_quantity' => $item['stock_quantity'],
* Filter to prepare extra columns in the export item for the stock
'woocommerce_report_stock_prepare_export_item',