Adding fields
-
Hi Ankit,
I am trying to add fields to the csv file. I can do it using the way che_idan suggested b;y editing the plugin directly. But I was hoping to do it in the funtions.php file with the wpg_order_columns and wpg_before_csv_write hooks but can’t seem to get it to work.Would you have an example of this. This was my attempt.
function extra_order_columns($cols) { $cols['wc_settings_tab_customer_address'] = '__( "Address", "woocommerce-simply-order-export" )'; return $cols; } add_filter( 'wpg_order_columns' , 'extra_order_columns' ); function extra_order_columns_data($csv_values) { array_push( $csv_values, self::customer_meta( get_the_ID(), '_billing_address_1' ) ); return $csv_values; } add_filter( 'wpg_before_csv_write' , 'extra_order_columns_data' );
https://www.ads-software.com/plugins/woocommerce-simply-order-export/
- The topic ‘Adding fields’ is closed to new replies.