Support

Home Forums Event Espresso Premium EE4 wait list with Ninja Forms not working

EE4 wait list with Ninja Forms not working

Posted: July 29, 2017 at 11:43 am

Viewing 6 reply threads


hoboken

July 29, 2017 at 11:43 am

I followed this procedure for creating a waiting list with Ninja Forms, but nothing appears for the event with the SOLD OUT message. Can you help? I created the Ninja form, pasted the PHP code into functions.php, and replaced the sample form ID with the correct one for my form. THANKS!


hoboken

July 29, 2017 at 11:57 am

P.S. Here is a link to a sold-out event on our test site:
http://wp.hobokenchildrenstheater.com/events/acting-pre-teen-2017-fall/


hoboken

July 29, 2017 at 12:28 pm

Oh, and I’m using Ninja Forms 3.1.6, and EE 4.9.45p.

Here’s the code from my functions.php:


// WAIT LIST
// Display a contact form when an event is sold out

function ee_espresso_clean_event_status( $event ) {
    $status = $event instanceof EE_Event ? $event->get_active_status() : 'inactive';
    return $status;
}

function ee_special_sold_out_message( $EVT_ID, $event ) {

    //Set the ID of the Ninja form you wish to call here
    $ninja_forms_id = 2;

    //Check if the event is sold out
    if ( ee_espresso_clean_event_status( $event ) == 'DTS' ) {
        if( method_exists( 'Ninja_Forms', 'display') ) {
            //Using Ninja Forms v3+
            Ninja_Forms()->display( $ninja_forms_id );
        } elseif( function_exists( 'ninja_forms_display_form' ) ) {
            //Using a previous version of Ninja Forms
            ninja_forms_display_form( $ninja_forms_id );
        }
    }
}
add_action( 'AHEE__ticket_selector_chart__template__after_ticket_selector', 'ee_special_sold_out_message', 10, 2 );


hoboken

July 30, 2017 at 1:33 pm

Hmm, suddenly today I’m seeing the Wait List form! Not sure what changed, if anything. But I only see it for an event where ALL the datetimes are sold out (see Acting Pre-Teen on this page). I’m not seeing the Wait List form for another event where ONE datetime is sold out but tickets are still available for that event’s OTHER datetime (see Sing Dance Act on that same page). Can I edit the PHP function so that an event’s Wait List triggers when ANY of that event’s datetimes are sold out?


hoboken

July 30, 2017 at 1:51 pm

Oops, another issue: It seems when I’m trying to make the Wait List function work on a category page, the form appears only for the first SOLD OUT instance? Again, see this page, where I now also have Acting Teen sold out, in addition to Acting Pre-Teen, but only the latter is showing the Wait List form.

This most recent problem is less critical to our site than the problem of getting SOMETHING to trigger when ANY of the datetimes are sold out for an event. If we can get the trigger to work right, I can change the “something” to a link to a generic Wait List form on another page, where the user can fill in the name and date of the event manually.

Thanks for any assistance you can provide! 🙂


Tony

  • Support Staff

July 31, 2017 at 10:34 am

Looking at this event:

http://wp.hobokenchildrenstheater.com/events/sing-dance-act-2017-fall/

Are the individual tickets set to only give access to each specific datetime?

There’s another version of the Ninja form function here:

https://gist.github.com/Pebblo/c48f75894b232f405727cf5ebfa4f119

That loops over all of the available tickets on an event and if any of them have a status of sold out, displays the form.

Will that work for you?


hoboken

August 1, 2017 at 12:52 pm

Yes, the individual tickets each give access only to the associated datetime.

That alternate version of the function worked, thanks!!

Viewing 6 reply threads

The support post ‘EE4 wait list with Ninja Forms not working’ 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