<?php // Do not include this if already open! Code goes in theme functions.php.
function woo_force_update_user_role( $order_id ) {
$order = new WC_Order( $order_id );
if ( $order->user_id > 0 ) {
$user = new WP_User( $order->user_id );
// Remove role
$user->remove_role( 'subscriber' );
// Add role
$user->add_role( 'customer' );
}
}
add_action( 'woocommerce_order_status_completed', 'woo_force_update_user_role' );