Order Notes
-
Hi There,
Is there any way to export the order notes? I have looked through all of the options and don’t see any option to export the notes included in WooCommerce orders. I am open to a php solution if need be.
Best,
Jeff
-
hi Jeff
Please, open section “Setup Fields” and drag field “Order Notes” or “Customer Note”.
if you see only GREEN fields — turn off “Summary by products” mode.
thanks, Alex
Hi @algolplus
This is great. Is there any way to have individual order notes separated by “/”? Right now it pushes them together so it is hard to tell where one order note begins and where another ends.
Also, it puts all of the order notes in one section which will be covered up by other columns. Is there any way to have it create another row when the order notes section is too long?
Let me know what is possible.
Best,
Jeffhi Jeff
open section “Misc Settings” and add this PHP code.
thanks , Alexadd_filter('woe_get_order_value_order_notes',function ($value, $order,$fieldname) { return preg_replace( "/\r|\n/", "/", $value); },10,3);I think ti’s possible to add each note as separate row.
But you should be PHP programmer.please, check this page https://docs.algolplus.com/algol_order_export/add-product-rows/
Hi @algolplus
This brings me to a follow up question. Is there any way to only export the most recent order note through misc settings? I tried unchecking export all order notes but it didn’t seem to change anything.
Best,
JeffYou should replace previous code with this version
add_filter('woe_get_order_value_order_notes',function ($value, $order,$fieldname) { $records = explode("\n",$value); return reset($records); },10,3);Hi @algolplus
This is another great step. However, I now see that it is counting an “enter key” within a single order note as the beginning of a new note.
For instance when you send a note to a customer and start off with:
“Hello John,Your order has been…”
It thinks Hello John, is its own separate note instead of just the beginning of the complete note. Is there any way to adjust this so it doesn’t read an enter as a new note?
Best,
Jeffok, I got it.
but it’s more complexadd_filter('woe_get_order_value_order_notes',function ($value, $order,$fieldname) { $args = array( 'post_id' => $order->id, 'approve' => 'approve', 'type' => 'order_note', 'search' => '', ); // woocommerce hides such records by default remove_filter( 'comments_clauses', array( 'WC_Comments', 'exclude_order_comments' ), 10 ); $notes = get_comments( $args ); add_filter( 'comments_clauses', array( 'WC_Comments', 'exclude_order_comments' ), 10, 1 ); $value = ''; if(!empty($notes)) { $value = $notes[0]->comment_content; } return $value; },10,3);you’re very welcome
The topic ‘Order Notes’ is closed to new replies.