Support

Home Forums Event Espresso Premium EE4 – Change phone number in espresso_registrations page

EE4 – Change phone number in espresso_registrations page

Posted: August 1, 2016 at 6:05 am

Viewing 8 reply threads


JacquesMivi

August 1, 2016 at 6:05 am

Hello,

When I edit an attendee and I change his phone number, it seems to have differents conduct.

URL : admin.php?page=espresso_registrations&action=edit_attendee&post=5603&edit_attendee_nonce=0d39b8a6b5&return=editpost

Sometimes it updates all the attendees of this contact.
Sometimes it updates only the attendee related to this page.

Could you help me to understand the correct behaviour ?

My aim is to create a mini front form where the user can change his phone number. I use his email to select all associated attendees.
I don’t know if I have to change all the associates phone numbers or just for a specific registration.

Thanks for your help,


Tony

  • Support Staff

August 1, 2016 at 7:39 am

Hi there,

Sometimes it updates all the attendees of this contact.
Sometimes it updates only the attendee related to this page.

It sounds like your changing the contact created during the registration, so if the contact has more than one registration assigned to it, you will see that change on each registration.

With EE registrations are assigned to a specific contact.

A single contact can have multiple registrations assigned to it.

So if its changing all of the registrations, they were all assigned to a single contact.

If its changing just a single registration that contact was only assigned to that registration.

Can you link me an event so I can see how you have your registration form set up please?


JacquesMivi

August 1, 2016 at 7:49 am

Here is a link to try
https://www.viviarto.com/ateliers-stages/improvisation-theatrale-paris-test-2-pour-ticket/

There it an ID_user attached at a registration or attendee ?
I just find att_email to have a key between the wp_user and his ee_registrations.


Tony

  • Support Staff

August 1, 2016 at 4:47 pm

Yeah so I i register onto that event regardless of how many tickets I select each of the registrations will be assigned to the one contact, which means editing the contact shows the same change across all of the registrations.

There it an ID_user attached at a registration or attendee ?
I just find att_email to have a key between the wp_user and his ee_registrations.

Apologies but I’m not sure I understand.

The EE contact is linked to the User account using the User ID and the ATT_ID using user_meta (wp_usermeta) with the key ‘wp_EE_Attendee_ID’.

So a User_ID is assigned a EE_Attendee_ID within usermeta – http://take.ms/oEpY3

That links an individual user account to the EE contact.


JacquesMivi

August 2, 2016 at 1:24 am

Perfect, I understand.

Sorry, can you try this event (but without register because its an official organizer)
https://www.viviarto.com/ateliers-stages/improvisation-theatrale-paris-cours-dete-dimprovisation-theatrale/

It has two forms is you select two participants, so the behaviour is different in database.

At final, is it a good idea to interacting with email as a key (instead of user_id) to change all the lines in attendee table ? Or do you recomend to use user_id and usermeta table ?


Tony

  • Support Staff

August 2, 2016 at 4:41 am

Sorry, can you try this event (but without register because its an official organizer)
https://www.viviarto.com/ateliers-stages/improvisation-theatrale-paris-cours-dete-dimprovisation-theatrale/

As that event requests the personal information question group for additional registrants it will create a new contact if different details are entered into each registration. Meaning if you then edit the contact you will edit the contact for each individual registration.

At final, is it a good idea to interacting with email as a key (instead of user_id) to change all the lines in attendee table ? Or do you recomend to use user_id and usermeta table ?

It depends what your trying to do.

Do you mean linking the current user id with the EE contact?


JacquesMivi

August 2, 2016 at 5:40 am

It depends what your trying to do. Do you mean linking the current user id with the EE contact?

I want a front end form, where a user (connected) can change his phone number for his registrations. I use this code but I’m asking myself if its good for EE4 operations.

/* Update */
function _update_attendee_phone_event($ATT_EMAIL, $ATT_PHONE) {
global $wpdb;

$message = $wpdb->update(
$wpdb->prefix . “esp_attendee_meta”,
array(
‘ATT_phone’ => $ATT_PHONE // New Phone
),
array( ‘ATT_email’ => $ATT_EMAIL ), // Existing email_user
array(
‘%s’
)
);

return $message;
}

What do you think ?


Tony

  • Support Staff

August 2, 2016 at 6:03 am

No because that is relying on ATT_EMAIL always being unique for every contact, that may not be the case.

You’ll want to use the wp_EE_Attendee_ID meta value and link the current user_id with the EE contact assigned to their account.


JacquesMivi

August 2, 2016 at 6:50 am

Thanks for your help, I will work to this.

Viewing 8 reply threads

The support post ‘EE4 – Change phone number in espresso_registrations page’ 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