• 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)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Split orders Note’ is closed to new replies.