Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author algol.plus

    (@algolplus)

    try this code

    you should use lastest version which I’ve sent just now !

    //1. add fields
    add_filter('woe_get_order_fields', 'woe_func_add_order_fields');
    function woe_func_add_order_fields($fields) {
    	$fields['name_new_array'] = array( 'label' => 'name_new_array', 'colname' => 'name_new_array', 'segment' => 'common', 'checked' => 1 );
    	return $fields;
    }
    
    //2. prepare field for json
    add_filter('woe_get_order_json_value_name_new_array', 'woe_get_value_name_new_array', 10, 2);
    function woe_get_value_name_new_array($value,$obj_order) {
    	return array(
    		"copy payment title"=>$obj_order->payment_method_title,
    		"copy order total"=>$obj_order->get_total(),
    	) ;
    }
    Thread Starter cfeldens

    (@cfeldens)

    Fantastic. Excellent. Perfect.
    The best plugins and support export orders for Woocommerce.
    Success! ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Add a custom array to automatic export, please!’ is closed to new replies.