Viewing 8 replies - 1 through 8 (of 8 total)
  • Hi,

    Thanks for using this plugin.

    Please paste the following code to your theme’s functions.php file and let me know if this works for you as expected.

    function wpg_add_columns($cols) {
    
    	$cols['wc_settings_tab_order_date'] = __('Order Date', 'mytheme');
    	return $cols;
    }
    add_filter('wpg_order_columns', 'wpg_add_columns');
    
    function wpg_add_fields($settings) {
    
    	$settings['payment_method'] = array(
    								'name' => __( 'Order date', 'woocommerce-simply-order-export' ),
    								'type' => 'checkbox',
    								'desc' => __( 'Order date', 'woocommerce-simply-order-export' ),
    								'id'   => 'wc_settings_tab_order_date'
    							);
    
    	return $settings;
    
    }
    add_filter('wc_settings_tab_order_export', 'wpg_add_fields');
    
    function csv_write( &$csv, $od, $fields ) {
    
    	if( !empty( $fields['wc_settings_tab_order_date'] ) && $fields['wc_settings_tab_order_date'] === true ){
    		array_push( $csv, $od->order_date );
    	}
    
    }
    add_action('wpg_before_csv_write', 'csv_write', 10, 3);

    Waiting for your response.

    Regards
    Ankit

    Thread Starter Babyrun

    (@babyrun)

    anywhere in my functions.php file ?

    Thread Starter Babyrun

    (@babyrun)

    I pasted at the bottom of function.php but it created a disaster

    I think your theme does not allow it do add anything at bottom of functions.php

    What happened to your site by the way ? Is your site working now ?

    You can give me details of your site here I can do this for you.

    Regards
    Ankit G.

    Thread Starter Babyrun

    (@babyrun)

    I asked my coder to have a look and it works fine now … great plugin that I’ll start using soon. Thank you very much.

    Hi,

    Its a good news. Please do not forget to rate the plugin here. 🙂
    Regards

    I added the code to the functions.php file and nothing, the csv comes out the same, should I have changed anything on the settings for it to work properly?

    David

    Hi David,

    Please use add-on plugin to export order date: http://sharethingz.com/downloads/woocommerce-simply-order-export-add-on/

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Add order date into export .CSV file’ is closed to new replies.