• Resolved Robert Wo.

    (@robertbrow)


    I need to split user order notes.
    I search in support so I get note using this code:

    
    add_filter('woe_get_order_value_private_notes',function ($value, $order,$fieldname) {
    	remove_filter( 'comments_clauses', array( 'WC_Comments', 'exclude_order_comments' ) );
    	$args  = array(
    		'post_id' => $order->get_id(),
    		'approve' => 'approve',
    		'type'    => 'order_note',
    		'orderby' => 'comment_ID',
    		'order'   => 'ASC',
    		);
    	$notes = get_comments( $args );
    	add_filter( 'comments_clauses', array( 'WC_Comments', 'exclude_order_comments' )  );
    
    	$lines = array();
    	foreach($notes as $note) {
    		if($note->comment_author!= !get_comment_meta( $note->comment_ID, 'is_customer_note', true ) ) 
    			$lines[] = $note->comment_content;
    	}
    	return join("\n",$lines);
    },10,3);
    

    But I receive all notes in one row.
    I need they be in separated column. Could you help me?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Robert Wo.

    (@robertbrow)

    Solved using custom field.

    Plugin Author algol.plus

    (@algolplus)

    could you paste final code ?
    it can be useful for another users.

    Thread Starter Robert Wo.

    (@robertbrow)

    1) Install Woocommerce Custom Fields
    2) Configure the plugin
    3) In Advanced Order Export configure new meta keys as _wc_acof_2 (Replace 2 with the ID of Woocommerce Custom Fields.

    Plugin Author algol.plus

    (@algolplus)

    thank you.

    have a good weekend

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Split orders Note’ is closed to new replies.