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

    (@algolplus)

    hi

    “Processing” is not final state, so if order was completed

    You can see only text(+ date) in order notes as
    “Order status changed from Pending Payment to Processing.”

    Do you use english language?
    thanks, alex

    Thread Starter mwestrik

    (@mwestrik)

    yes, i do use english too.

    the order date (pending) is for unpaid orders, “completed” is for shipped orders, and we use “processing” for paid orders. And that is what accounting needs.

    Plugin Author algol.plus

    (@algolplus)

    try add this code to functions.php

    //1. add fields to  section "Setup Fields"
    add_filter('woe_get_order_fields', 'woe_func_add_order_fields');
    function woe_func_add_order_fields($fields) {
        $fields['date_processed'] = array( 'label' => 'Date Processed', 'colname' =>'Date Processed', 'segment' => 'user', 'checked' => 1 );
        return $fields;
    }
    
    //2. prepare field for xls,csv
    add_filter('woe_get_order_xls_value_date_processed','woe_get_value_date_processed',10, 2);
    add_filter('woe_get_order_csv_value_date_processed','woe_get_value_date_processed',10, 2);
    function woe_get_value_date_processed($value,$order) {
        $args = array(
    		'post_id' 	=> $order->id,
    		'approve' 	=> 'approve',
    		'type' 		=> 'order_note',
    		'search'        => 'Order status changed from Pending Payment to Processing.',
        );
        // 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 );
    
        $date_processed = '';
        if(!empty($notes)) {
            $date_processed = date("m/d/Y",strtotime($notes[0]->comment_date)); // to US format
        }
        return $date_processed;
    }
    Thread Starter mwestrik

    (@mwestrik)

    It worked partly. It did add the field to the export page, and it did add a column to my output file, but there’s no dates in there, just blanks.

    Plugin Author algol.plus

    (@algolplus)

    could you review order notes for first order?

    do you see text “Order status changed from Pending Payment to Processing.” ?

    Thread Starter mwestrik

    (@mwestrik)

    problem fixed. thanks for your help!

    Plugin Author algol.plus

    (@algolplus)

    could you provide a bit more details? how did you solve it ?

    I suppose other users can ask for this feature too

    Thread Starter mwestrik

    (@mwestrik)

    nothing special, i just had a typo before… So a decent copy paste of your solution worked.

    Plugin Author algol.plus

    (@algolplus)

    thank you!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘processing date’ is closed to new replies.