diff --git a/backend/app/plugins/wiaas/includes/admin/delivery-process/class-wiaas-admin-delivery-process-order.php b/backend/app/plugins/wiaas/includes/admin/delivery-process/class-wiaas-admin-delivery-process-order.php index b6133fb..b3f0f21 100644 --- a/backend/app/plugins/wiaas/includes/admin/delivery-process/class-wiaas-admin-delivery-process-order.php +++ b/backend/app/plugins/wiaas/includes/admin/delivery-process/class-wiaas-admin-delivery-process-order.php @@ -18,7 +18,7 @@ class Wiaas_Admin_Delivery_Process_Order { add_action('add_meta_boxes', array(__CLASS__, 'add_delivery_process_metabox'), 100 ); - add_action('woocommerce_process_shop_order_meta', array(__CLASS__, 'maybe_assign_delivery_process')); + add_action('woocommerce_process_shop_order_meta', array(__CLASS__, 'maybe_assign_delivery_process'), 999); } /** diff --git a/backend/app/plugins/wiaas/includes/class-wiaas-delivery-process.php b/backend/app/plugins/wiaas/includes/class-wiaas-delivery-process.php index b1cd25d..160dcec 100644 --- a/backend/app/plugins/wiaas/includes/class-wiaas-delivery-process.php +++ b/backend/app/plugins/wiaas/includes/class-wiaas-delivery-process.php @@ -74,6 +74,11 @@ class Wiaas_Delivery_Process { update_post_meta($order_id, 'wiaas_delivery_process_id', $process_id); update_post_meta($order_id, 'wiaas_delivery_process_entry_id', $process_entry_id); + $order = wc_get_order($order_id); + + $order->set_status('processing', 'Started order delivery process.', true); + $order->save(); + return $process_entry_id; } return false;