WordPress.org

Support

Support » Plugins and Hacks » Events Manager » [Resolved] [Plugin: Events Manager] Event Manager Plugin redirect after booking

[Resolved] [Plugin: Events Manager] Event Manager Plugin redirect after booking

  • Great plugin, I’ve just started setting up a few events with the free version and if all goes well I’ll most likely upgrade.
    There is one feature that is very important to the way I communicate with my students and I don’t know how to do it or if it can be done by a newbie like me.

    I would like those participants that have successfully booked for an event, to then have access to workshop prep information that I don’t want to make public in the event description. I don’t mind doing it individually by email for each participant when it’s a small group but when it’s a larger group it would be way more work than I have time for.

    Is there way to redirect to a URL of my choice on my site after the booking ( so that it is not public), where they can find this information?

    or add it conditionally to the booking confirmation feedback message, with a conditional placement code…I have been reading but don’t understand those yet? or use an attribute, which I understand even less.

    Any ideas on if this can be done, and if so how, would greatly be appreciated.

    Thanks in advance

    p.s. I posted 6 hours ago but didn’t place my post in the EM section so it seems to be lost in the undefined WP forum…please forgive the duplication.

    http://wordpress.org/extend/plugins/events-manager/

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Marcus

    @netweblogic

    good thing you reposted here (That other one is lost :))

    you can do this actually, but you need to know some JS. see how includes/js/bookingform.js works and you can bind an event to em_booking_gateway_add

    Thanks for such a quick reply. Unfortunately you lost me after the first JS, which I figured out means Java Script.
    I gather I didn’t mention on this post about being a newbie at this.
    I’m pretty good at figuring things out but you totally lost me with… see how includes/js/bookingform.js works and you can bind an event to em_booking_gateway_add
    Where can I read up about this?
    Thanks

    ….I still think it’s a great plugin, just surprised that not more people have the same request.

    W3Schools.com has a Java Script tutorial that might give you some background

    I have the same request. @marcus or @pawriter, would you mind sharing a bit of js knowledge and where we would implement the redirect action in the includes/js/bookingform.js file ?

    For example, after successful booking, re-direct to thank you page.
    My guess is that it needs to be implemented within the code somewhere here:

    success : function(response, statusText, xhr, $form) {
    	$('#em-loading').remove();
    	$('.em-booking-message').remove();
    	$(document).trigger('em_booking_gateway_add', [response]);
    	if(response.result && typeof Recaptcha != 'undefined'){
    	Recaptcha.reload();
    	}
    em_booking_doing_ajax = false;
    }

    Thanks for any help you can provide.

    Progress! Thank you @pawriter and @askjason. I’m following you Askjason, I’ve found the same spot…in the success section. Found this in the tutorials http://www.w3schools.com/jquery/event_bind.asp

    Now how to bind an event to em_booking_gateway_add , so that there is a redirect to a thank you page?

    Any more help coming our way would be very appreciated.

    I was equally surprised there is no built-in redirect after making a booking! (seems like common practive to me)

    Anyway, after some tinkering (I am really a novice when it comes to coding) I figured out that the following might work – just add the line window.open… at the bottom of the bookingform.js file 🙂

    `complete : function(){
    em_booking_doing_ajax = false;
    $(‘#em-loading’).remove();
    window.open(‘URL’,’_self’);
    }
    });
    return false;
    });`

    Plugin Author Marcus

    @netweblogic

    In the next update, I’ll add a em_booking_success event to the document in jQuery so you can hook into that event without hacking the plugin.

    we could add this when time permits

    I’ve added this code to the in the head section of the page that the form is sitting on:

    <script type="text/javascript">
    $(function() {
    	function em_booking_success() {
    	window.location.replace("http://google.com");
    	}
    });
    </script>

    Doesn’t seem to work but I’m not sure if I’m going about it the right way.. any help would be appreciated. Thanks!

    Plugin Author Marcus

    @netweblogic

    See this tutorial, same concept but different hook name – http://wp-events-plugin.com/tutorials/modifying-event-location-google-maps/

    replace em_maps_location_hook with em_booking_success and that should work.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘[Resolved] [Plugin: Events Manager] Event Manager Plugin redirect after booking’ is closed to new replies.
Skip to toolbar