Support

Home Forums Event Espresso Premium Auto-enrolling members into a course if sign up to event

Auto-enrolling members into a course if sign up to event

Posted: June 27, 2019 at 6:02 pm

Viewing 1 reply thread


salda

June 27, 2019 at 6:02 pm

Hi folks,

I understand this’ll probably be a really specific scenario but I need to check if I’m missing something (I’ve been beating my head against the wall trying to figure out a way for some time).

We run both Event Espresso and LifterLMS on our site. Sometimes the events we host are webinars, which we later turn into courses within LifterLMS.

What my colleague would like to do is find a way to automatically enrol anyone who’s paid and registered for the webinar event into the corresponding LifterLMS course.

I’ve gotten half way there using the Event Espresso addon, the one that signs the user up on event registration, as I am able to assign them to the role of Student, which Lifter uses.

The final step is obviously going to require some customisation on my part, but I’m really not sure where I should be looking. I need some way to tell WordPress that *this webinar* in Event Espresso corresponds to *this course* in LifterLMS (fyi, we’re pre-creating the courses so we can potentially link the two).
Once there’s a link between the two, upon registration, I need to hit the auto-enrol function that assigns that event registrant to that specific course that its been linked to.

Like I said…really specific scenario, just after some info on where I might start customising, eg if anyone has worked out a way to do an extra/specific thing upon user registration?

Cheers,
Min


Tony

  • Support Staff

June 28, 2019 at 3:50 am

Hi Min,

I’ve gotten half way there using the Event Espresso addon, the one that signs the user up on event registration, as I am able to assign them to the role of Student, which Lifter uses.

Just to note, you need to be careful as to what you assign as this point because the user account is created before registration is complete, meaning before they have paid.

The final step is obviously going to require some customisation on my part, but I’m really not sure where I should be looking. I need some way to tell WordPress that *this webinar* in Event Espresso corresponds to *this course* in LifterLMS (fyi, we’re pre-creating the courses so we can potentially link the two).

For that, you can use a custom field on the event which can be as simple as adding the webinar ID (or whatever LifterLMS wants you to provide to enrole a user) to the field, then pulling that as a custom meta field from the event.

If you have the event object thats as simple as $custom_field = $event->get_post_meta($meta_key, $single); (The EE models have a wrapper for get_post_meta() so if your using our models system (which I recommend you do) then you don’t need to pass the ID of the current post)

How you manage those fields is up to you, ACF could be used for a ‘nicer’ output as again they are just custom fields linked to an event post.

Once there’s a link between the two, upon registration, I need to hit the auto-enrol function that assigns that event registrant to that specific course that its been linked to.

For that I recommend you use a different hook, such as AHEE__EE_Registration__set_status__to_approved meaning its only fired once the registration has been set to ‘Approved’ (which happens automatically when payment is made, or based on your ‘Default Registration Status’ setting if you have it set to Approved).

Like I said…really specific scenario, just after some info on where I might start customising, eg if anyone has worked out a way to do an extra/specific thing upon user registration?

It’s actually similar to what LearnDash do with Event Espresso so you might want to check them out.

https://www.learndash.com/add-on/event-espresso/

Viewing 1 reply thread

The support post ‘Auto-enrolling members into a course if sign up to event’ 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