Title: Second custom static field   date format
Last modified: August 31, 2016

---

# Second custom static field date format

 *  Resolved [heyluce](https://wordpress.org/support/users/heyluce/)
 * (@heyluce)
 * [10 years ago](https://wordpress.org/support/topic/second-custom-static-field/)
 * Hi,
 * i want to add a second static field to my csv export. I found on the documentation
   site this code which works perfectly.
 *     ```
       function custom_woo_ce_order_fields( $fields ) {
   
       	$fields[] = array(
       		'name' => 'static_field',
       		'label' => __( 'Customer ID', 'woo_ce' )
       	);
       	return $fields;
   
       }
       add_filter( 'woo_ce_order_fields', 'custom_woo_ce_order_fields' );
   
       function custom_woo_ce_order( $order, $order_id ) {
   
       	$order->static_field = 'AQU';
       	return $order;
   
       }
       add_filter( 'woo_ce_order', 'custom_woo_ce_order', 10, 2 );
       ```
   
 * now i want to add a second static field with the name “AQU1”. I just copied it
   and renamed the functions, but it is not appearing. could you please help me 
   out with this?
 * The second issue is, i changed the date format to “d_m_Y”.
 * but my exported filename still shows this format: 2016_06_07
 * Thanks a lot!
 * [https://wordpress.org/plugins/woocommerce-exporter/](https://wordpress.org/plugins/woocommerce-exporter/)

Viewing 1 replies (of 1 total)

 *  [Michael Visser](https://wordpress.org/support/users/visser/)
 * (@visser)
 * [10 years ago](https://wordpress.org/support/topic/second-custom-static-field/#post-7453385)
 * Hi heyluce, I’ll answer here and close your Premium Support topic so others can
   see the answer. 🙂
 * I’m not an expert at using markup here on w.org so it might take a few attempts…
 * Notice below that within custom_woo_ce_order_fields() the ‘name’ attribute of
   the $fields array items are unique (e.g. static_field_1, static_field_2), you
   need to reference these unique field names within custom_woo_ce_order(). Does
   this help?
 * `
    function custom_woo_ce_order_fields( $fields ) {
 *  $fields[] = array(
    'name' => 'static_field_1', 'label' => __( 'Customer ID','
   woo_ce' ) ); $fields[] = array( 'name' => 'static_field_2', 'label' => __( 'Customer
   Mail Preference', 'woo_ce' ) ); return $fields;
 * }
    add_filter( 'woo_ce_order_fields', 'custom_woo_ce_order_fields' );
 * function custom_woo_ce_order( $order, $order_id ) {
 *  $order->static_field_1 = 'ID12345';
    $order->static_field_2 = 'SMS only please';
   return $order;
 * }
    add_filter( 'woo_ce_order', 'custom_woo_ce_order', 10, 2 );
 * Regarding your date formatting issue can you please open a new topic and incldue
   details here:
 * [https://wordpress.org/support/topic/important-read-this-before-posting-5?replies=1](https://wordpress.org/support/topic/important-read-this-before-posting-5?replies=1)

Viewing 1 replies (of 1 total)

The topic ‘Second custom static field date format’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce-exporter/assets/icon-256x256.png?rev=986329)
 * [Store Exporter – Export WooCommerce Products, Orders, Subscriptions, Customers](https://wordpress.org/plugins/woocommerce-exporter/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce-exporter/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce-exporter/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce-exporter/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce-exporter/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce-exporter/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Michael Visser](https://wordpress.org/support/users/visser/)
 * Last activity: [10 years ago](https://wordpress.org/support/topic/second-custom-static-field/#post-7453385)
 * Status: resolved