Support » Plugin: WooCommerce » Is there a field like ‘order_status_changed_by’ in the ‘shop_order’ ?

  • Resolved 7o599

    (@7o599)


    My store has more than one shop mangers.
    I would like to know who changed order status.

    Is there a field like ‘order_status_changed_by’ with the value ‘user_id’ in the ‘shop_order’ ?

    Or how can I add this field to ‘shop_order’ ?

Viewing 1 replies (of 1 total)
  • Thread Starter 7o599

    (@7o599)

    Resolved by the code below:

    add_action('save_post','order_status_updated_by');
    function order_status_updated_by($post_id) {
    	$post_type = get_post_type($post_id);
    	if ($post_type != 'shop_order') return;
    	update_post_meta($post_id,'_order_status_changed_by',get_current_user_id());
    }
Viewing 1 replies (of 1 total)
  • The topic ‘Is there a field like ‘order_status_changed_by’ in the ‘shop_order’ ?’ is closed to new replies.