• Hello,

    Thank you so much for this simple, yet very effective plugin! I really like it.
    Is there a way to disable the feature that the order status will be set to “completed” when I have entered the tracking information? I only want to save the tracking information and send later when I manually set the order to “completed”

    Best,
    Andy

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi there,

    as a quick fix, just comment out line 251 of mimo-woocommerce-order-tracking.php (inside plugin dir):
    // $order->update_status( $this->order_status );
    That will prevent updating the order status. Don’t get confused when the order status will show “finished”. It’s not. Just refresh the page and you’ll see.

    Regards, Rado

    Hi again,

    no need for this quick fix. Just save the form (press update, not save and send from the wot meta box).
    It won’t work out of the box, because the code for saving the meta box content is wrong. Change from line 370

    			if ( isset( $_POST[ 'mimo_shipment_tracking_nonce' ] ) && wp_verify_nonce( $_POST[ 'mimo_shipment_tracking_nonce' ], 'mimo_shipment_tracking_data' ) ) return;
    
    			if ( ! current_user_can( 'edit_post', $post_id ) ) return;
    
    			if ( isset( $_POST['mimo_tracking_provider_id'] ) )
    				update_post_meta( $post_id, 'mimo_tracking_provider_id', sanitize_text_field( $_POST['mimo_tracking_provider_id'] ) );
    
    			if ( isset( $_POST['mimo_tracking_number'] ) )
    				update_post_meta( $post_id, 'mimo_tracking_number', sanitize_text_field( $_POST['mimo_tracking_number'] ) );
    
    			if ( isset( $_POST['mimo_date_shipped'] ) )
    				update_post_meta( $post_id, 'mimo_date_shipped', sanitize_text_field( $_POST['mimo_date_shipped'] ) );

    to

    	if ( isset( $_POST[ 'mimo_shipment_tracking_nonce' ] ) && wp_verify_nonce( $_POST[ 'mimo_shipment_tracking_nonce' ], 'mimo_shipment_tracking_data' ) ) {
    
                    if (!current_user_can('edit_post', $post_id)) return;
    
                    if (isset($_POST['mimo_tracking_provider_id']))
                        update_post_meta($post_id, 'mimo_tracking_provider_id', sanitize_text_field($_POST['mimo_tracking_provider_id']));
    
                    if (isset($_POST['mimo_tracking_number']))
                        update_post_meta($post_id, 'mimo_tracking_number', sanitize_text_field($_POST['mimo_tracking_number']));
    
                    if (isset($_POST['mimo_date_shipped']))
                        update_post_meta($post_id, 'mimo_date_shipped', sanitize_text_field($_POST['mimo_date_shipped']));
                }

    Regards, Rado

    • This reply was modified 5 years, 9 months ago by gutding.
    Thread Starter rumpelstilzchen94

    (@rumpelstilzchen94)

    Hey gutding,

    Thank you for your answer.

    My line 370 is empty and 371 begins with this:

    if ( ! current_user_can( 'edit_post', $post_id ) ) return;

    Not really sure what to do ??

    Edit: I replaced the code with your code but it was unable to save. Error in line 394

    syntax error, unexpected ‘public’ (T_PUBLIC)

    Hi Andy,

    the easiest thing to do: Just delete the original mimo-woocommerce-order-tracking.php file and replace it with this one. Then everything will work as expected (like hitting update for saving the tracking data without completing the order and sending emails or adding new providers).

    Regards, Rado

    Thread Starter rumpelstilzchen94

    (@rumpelstilzchen94)

    I replaced my file with yours and it somehow works ??

    The problem is that my barcode scanner sends an “Enter” after each scanned barcode. That way it will “hit” the Save & Send Button of the plugin and thus finalize the order. I just want it to save the tracking number, but not send it yet

    Ok, then you should probably comment out lines 251 & 252 in mimo-woocommerce-order-tracking.php. This way the order status won’t get updated and no mail will be sent.
    It should look like this:

    // $order = new WC_Order( $post_id );
    // $order->update_status( $this->order_status );

    Just add the 2 slashes in front of each line.

    Regards, Rado

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Don’t set order status to completed’ is closed to new replies.