Support » Plugin: Advanced Order Export For WooCommerce » Private notes and customer notes

  • Resolved toni3diaz

    (@toni3diaz)


    Hello!

    amazing plugin here, thanks a lot. I see you can export the order notes, but is there a way to differentiate “Private notes” from “notes to the customer”? I use the private note to keep record of shipping expenses from post office (manually paid). Actually I would like to discard the system generated notes (status changes, etc) and keep only the ones I create.

    Thank you!

    • This topic was modified 1 year ago by toni3diaz.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author algol.plus

    (@algolplus)

    Hello

    Do you want to export only private notes as separate column ?

    toni3diaz

    (@toni3diaz)

    Yes! At least discard system generated ones.

    Plugin Author algol.plus

    (@algolplus)

    hi

    Please, add new field https://algolplus.freshdesk.com/support/solutions/articles/25000016635-add-calculated-field-for-order-

    Use meta key private_notes and add following code to “Misc Settings”.
    thanks, Alex

    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!='WooCommerce' AND !get_comment_meta( $note->comment_ID, 'is_customer_note', true ) ) 
    			$lines[] = $note->comment_content;
    	}
    	return join("\n",$lines);
    },10,3);
    toni3diaz

    (@toni3diaz)

    Amazing support, thanks a lot 🙂

    Plugin Author algol.plus

    (@algolplus)

    you’re welcome

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Private notes and customer notes’ is closed to new replies.