function set_order_status_on_export($post_id, $exportObject)
{
// Retrieve export ID.
$export_id = ( isset( $_GET['id'] ) ? $_GET['id'] : ( isset( $_GET['export_id'] ) ? $_GET['export_id'] : 'new' ) );
// Only run for export 1.
if ($export_id == "1") {
// Retrieve Order object.
$order = new WC_Order($post_id);
// Set Order status to completed.
$order->update_status('completed', 'export_completed');
}
}
add_action('pmxe_exported_post', 'set_order_status_on_export', 10, 2);
#all export #export #functions #orders #status #WC #woocommerce