Support

Home Forums Event Espresso Premium Waitlist and Contact Form 7

Waitlist and Contact Form 7

Posted: November 1, 2016 at 9:08 am

Viewing 6 reply threads


asse2014

November 1, 2016 at 9:08 am

Like the idea of using Ninja Forms to create a waitlist. Unfortunately the solution at https://gist.github.com/joshfeck/fa7725952e9087c1a781 doos not work for me since Ninja forms will not work on my site.

Can you supply the snippet of code to make it work with Contact Form 7?

Thanks!


Josh

  • Support Staff

November 1, 2016 at 12:06 pm

I checked Contact Form 7’s documentation and it says to wrap their short code in a do_shortcode() function to use within template code:

http://contactform7.com/faq/can-i-embed-a-contact-form-into-my-template-file/


asse2014

November 2, 2016 at 7:22 am

Josh,

I have tried this

//* Please do NOT include the opening php tag, except of course if you’re starting with a blank file
// display a contact form when the event is sold out
// for waitlists
function espresso_clean_event_status( $EVT_ID ) {
$event = EEH_Event_View::get_event( $EVT_ID );
$status = $event instanceof EE_Event ? $event->get_active_status() : ‘inactive’;
return $status;
}
add_action( ‘AHEE_event_details_after_the_content’, ‘ee_special_sold_out_message’ );
function ee_special_sold_out_message( $post ) {
if ( espresso_clean_event_status() == ‘Sold Out’ ){
echo do_shortcode( ‘[contact-form-7 id=”180″ title=”Contact form 1″]’ );
}
}

But nothing displays.


Josh

  • Support Staff

November 3, 2016 at 1:47 pm

So you see in the original code where it has this?

if ( espresso_clean_event_status( $post->ID ) == 'DTS' ){

Your code has this instead:

if ( espresso_clean_event_status() == 'Sold Out' ){


asse2014

November 9, 2016 at 11:05 am

Perfect… Thanks! How would I get the waitlist form to appear after the ticket selector rather than the content?


Josh

  • Support Staff

November 9, 2016 at 12:47 pm

Instead of using this hook:

AHEE_event_details_after_the_content

you use this hook:

AHEE__ticket_selector_chart__template__after_ticket_selector


asse2014

November 10, 2016 at 6:48 am

Awesome… thanks some much!

Viewing 6 reply threads

The support post ‘Waitlist and Contact Form 7’ 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