Title: CSV EXPORT
Last modified: November 5, 2016

---

# CSV EXPORT

 *  Resolved [zefyr](https://wordpress.org/support/users/zefyr/)
 * (@zefyr)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/csv-export-11/)
 * Hello, I use Orders CSV export, how can I send/load data from this order custom
   fields?
 * I use this for custom csv columns
 *     ```
       function wc_csv_export_order_line_item_id($line_item, $item, $product) { 
         $line_item['sku'] = substr($product->get_sku(), 0, 4);
         $line_item['sku_full'] = $product->get_sku();
         $line_item['item_price'] = $product->get_price();
         return $line_item;
       }
       add_filter('wc_customer_order_csv_export_order_line_item', 'wc_csv_export_order_line_item_id', 10, 3);
       ```
   
 * Or this for order fields:
 *     ```
       function wc_csv_export_modify_row_data( $order_data, $order, $csv_generator ) {
               global $product, $tax, $woocoommerce;      
       	$custom_data = array(
       		'column_1' => get_post_meta($order->id, '_billing_company_number', true),
       		'column_2' => get_post_meta($order->id, '_billing_vat_number', true),
                       'column_3' => get_post_meta($order->id, '_billing_vat_number_2', true)
       	);
   
       	$new_order_data = array();
       	if ( isset( $csv_generator->order_format ) && ( 'default_one_row_per_item' == $csv_generator->order_format || 'legacy_one_row_per_item' == $csv_generator->order_format ) ) {
       		foreach ( $order_data as $data ) {
       			$new_order_data[] = array_merge( (array) $data, $custom_data );
       		}
       	} else {
       		$new_order_data = array_merge( $order_data, $custom_data );
       	}
       	return $new_order_data;
       }
       add_filter( 'wc_customer_order_csv_export_order_row', 'wc_csv_export_modify_row_data', 10, 3 );
       ```
   
 * Thank’s
    -  This topic was modified 9 years, 6 months ago by [zefyr](https://wordpress.org/support/users/zefyr/).
    -  This topic was modified 9 years, 6 months ago by [zefyr](https://wordpress.org/support/users/zefyr/).

Viewing 1 replies (of 1 total)

 *  Thread Starter [zefyr](https://wordpress.org/support/users/zefyr/)
 * (@zefyr)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/csv-export-11/#post-8401630)
 * I solved it:
 *     ```
       'column_4' => get_post_meta($order->id, 'wc_order_field_2906', true),
       'column_5' => get_post_meta($order->id, 'wc_order_field_8140', true),
       'column_6' => get_post_meta($order->id, 'wc_order_field_9549', true)
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘CSV EXPORT’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/flexible-woocommerce-checkout-field-
   editor.svg)
 * [Flexible Woocommerce Checkout Field Editor](https://wordpress.org/plugins/flexible-woocommerce-checkout-field-editor/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/flexible-woocommerce-checkout-field-editor/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/flexible-woocommerce-checkout-field-editor/)
 * [Active Topics](https://wordpress.org/support/plugin/flexible-woocommerce-checkout-field-editor/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/flexible-woocommerce-checkout-field-editor/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/flexible-woocommerce-checkout-field-editor/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [zefyr](https://wordpress.org/support/users/zefyr/)
 * Last activity: [9 years, 6 months ago](https://wordpress.org/support/topic/csv-export-11/#post-8401630)
 * Status: resolved