0
votes

I am looking for a way to auto Change Status of Order from Shipped (custom status i am using) to Completed but after 1 minute Can it be done?

thank

1

1 Answers

1
votes

You can do it using WP cron (for your case, once):

function finish_order_status($order_id){
    // your logic here
}

// custom hook listener
add_action('order_status_shipped', 'finish_order_status', 10, 1);

// You will call this when you set your custom status
wp_schedule_single_event(time() + 60, 'order_status_shipped', [$current_order_id]);