Support

Home Forums Event Espresso Premium Attendees can not see Events listed under "My Events Management" – EE3

Attendees can not see Events listed under "My Events Management" – EE3

Posted: September 4, 2015 at 3:53 am

Viewing 7 reply threads


Robert O’Halloran

September 4, 2015 at 3:53 am

I have a query in relation to viewing Events tickets I have purchased. When I am logged in as a subscriber, should I not be able to see any Events I am attending under: “”My Events Management”? At present this is blank under my profile even though I have purchased a ticket. Any assistance on this woudl be great!

Regards,

Robert


Dean

September 4, 2015 at 4:40 am

Hi Robert,

Was the user logged in when they registered for the event? If not, it will not know to log the registration for that user.

EE4 WP User Integration enhances this by checking the registration email against the registered user list and prompts the user to log in if it matches.


Robert O’Halloran

September 4, 2015 at 4:43 am

Hello,

Thanks for the swift reply. The user was not logged in. They register on purchase (they are set up as a user when they purchasing a ticket using a script a member of you team provided) We are EE3 due to some restrictions we had. Is it possible to do this with EE3? If not can we disable “My Events form the Dashboard area?”


Dean

September 4, 2015 at 5:16 am

Hi,

What was the code used to enable this?

You can disable the My Events menu with the following code added to a site specific plugin:

add_action( 'init' , 'remove_my_events' , 15 );
function remove_my_events() {
    remove_action('admin_menu', 'add_member_event_espressotration_menus');
}


Robert O’Halloran

September 4, 2015 at 6:24 am

Hello,

This is the code I was supplied:


//Add user to WP when they register for the event
add_action('action_hook_espresso_save_attendee_data','espresso_create_wp_user', 10, 1);
function espresso_create_wp_user($attendee_data) {
    if( username_exists( $attendee_data['email'] ) == NULL ) {
		global $org_options;	
		
		// Generate the password and create the user
		$password = wp_generate_password( 12, false );
		$user_id = wp_create_user( $attendee_data['email'], $password, $attendee_data['email'] );
	
		// Set the users details
		//Additional fields can be found here: http://codex.wordpress.org/Function_Reference/wp_update_user
		wp_update_user(
			array(
				'ID'			=> $user_id,
				'nickname'		=> $attendee_data['fname'] . ' ' . $attendee_data['lname'],
				'display_name'	=> $attendee_data['fname'] . ' ' . $attendee_data['lname'],
				'first_name'	=> $attendee_data['fname'],
				'last_name'		=> $attendee_data['lname'],
				'description'	=> __('Registered via event registration form.', 'event_espresso'),
			)
		);
	
		// Set the role
		$user = new WP_User( $user_id );
		$user->set_role( 'subscriber' );
	
		// Email the user
		wp_mail( $attendee_data['email'], 'Welcome to ' . $org_options['organization'], 'Your Username: ' .$attendee_data['email']. ' Your Password: ' . $password );
	
	} // end if
}


Tony

  • Support Staff

September 7, 2015 at 3:44 am

Hi Robert,

That does not add the first event that the user registers with into the members events database, so with that code the very first event will not show up within the profile.

Here is an updated version of the snippet that does add the event to ‘My Events’ – https://gist.github.com/Pebblo/7825452

However to note, this will only fix ‘My Events’ for new members created once this gist is in use. So current members will still not see the first event they registered onto, but new members will.


Robert O’Halloran

September 7, 2015 at 8:58 am

I appreciate your help on this. Thanks!


Tony

  • Support Staff

September 7, 2015 at 2:32 pm

You’re most welcome.

Please do let me know if this works as expected for you.

Viewing 7 reply threads

The support post ‘Attendees can not see Events listed under "My Events Management" – EE3’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso