Support » Plugin: WooCommerce Simply Order Export » Possible to export each order item into a separate column?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Ankit Gade

    (@ankitgadertcampcom)

    Hi,

    Thanks for your appreciating words. 🙂

    Currently this kind of arrangement is not present in the plugin.

    Ok thanks, but is it possible to add shipping address fields?

    Plugin Author Ankit Gade

    (@ankitgadertcampcom)

    Hi,
    Please add following code to functions.php of your theme. It should export the shipping address.

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

    Let me know if it works.

    Thank you.

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Possible to export each order item into a separate column?’ is closed to new replies.