Disable assigning users to shipment based on user role

Add following code in your functions.php file

//Disable assigning of agent
add_filter( 'wpcfe_assign_agent', 'disable_user_to_assign_agent', 1, 1 );
function disable_user_to_assign_agent( $users ){
    //To disable Administrator to assign shipment
	$key = array_search('administrator', $users);
	if ($key !== false){
		unset($users[$key]);
	}
    //To disable Employee to assign shipment
	$key = array_search('wpcargo_employee', $users);
	if ($key !== false){
		unset($users[$key]);
	}
    //To disable Branch Manager to assign shipment
	$key = array_search('wpcargo_branch_manager', $users);
	if ($key !== false){
		unset($users[$key]);
	}
    return $users;
}
//Disable assigning of client
add_filter( 'wpcfe_assign_client', 'disable_user_to_assign_client' );
function disable_user_to_assign_client( $users ){
    //To disable Administrator to assign shipment
	$key = array_search('administrator', $users);
	if ($key !== false){
		unset($users[$key]);
	}
    //To disable Employee to assign shipment
	$key = array_search('wpcargo_employee', $users);
	if ($key !== false){
		unset($users[$key]);
	}
    //To disable Branch Manager to assign shipment
	$key = array_search('wpcargo_branch_manager', $users);
	if ($key !== false){
		unset($users[$key]);
	}
	return $users;
}

//Disable assigning of branch manager
add_filter( 'wpcfe_assign_manager', 'disable_user_to_assign_manager' );
function disable_user_to_assign_manager( $users ){
    //To disable Administrator to assign shipment
	$key = array_search('administrator', $users);
	if ($key !== false){
		unset($users[$key]);
	}
    //To disable Employee to assign shipment
	$key = array_search('wpcargo_employee', $users);
	if ($key !== false){
		unset($users[$key]);
	}
    //To disable Branch Manager to assign shipment
	$key = array_search('wpcargo_branch_manager', $users);
	if ($key !== false){
		unset($users[$key]);
	}
	return $users;
}
2
    2
    Your Cart
    Remove
    Remove
    WPCargo Shipping Rate Package
    2 X $340.90 = $681.80