Dedicated bookings landingpage possible?

WordPress Event Management, Calendars & Registration Forums General Question Dedicated bookings landingpage possible?

This topic contains 6 replies, has 4 voices, and was last updated by  Stephen Harris 6 years, 8 months ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #9329

    In the moment when the booking has been placed the bookie got just a small confirmation message on the same page. This can be especially overseen, especially on our page where it’s placed partially under the fixed translucent main menue. The second problem is, that when we’ll use google adwords then it’s deficult to tell it the point when a conversion has been made. This would be much better to have a dedicated landing page for confirming the booking. Is it possible to redirect eo after booking to a certain page?

    Adrian Maleska
    #9335

    Yes it is possible as long as you are not using the offline payment gateway.

    Firstly, create a new page on your site informing the user of successful payment & booking, etc. Make sure that this page doesn’t appear in your menu bar, sitemap, etc so users don’t navigate to it manually or though a search engine.

    Once you’ve got that sorted out, see this blog post for code to add to your theme’s function file to enable the redirect.

    Note that this code was written specifically for the PayPal payment gateway, but slight alterations should make it work with other gateways too (with the exception of the offline gateway which doesn’t redirect).

    Hope this helps.

    Dario
    #9349

    What Dario says is correct, but you can also do this for Stripe & Offline Payment Gateway (but slightly differently). The reason is that in those two gateways, the gateway is processed without taking the user away from the site, so you can essentially ‘jump in’ before the user is redirected back to the event page and redirect anywhere you want. With the PayPal gateway you tell PayPal where you want the user to end up after payment and PayPal takes them straight there.

    The following will work for anyway gateway where the user remains ‘on-site’:

    //This will work only for gateways where you don't leave the site.
    add_action( 'eventorganiser_pre_gateway_booking_stripe', 'adrian_redirect_after_booking', 100, 4);
    add_action( 'eventorganiser_pre_gateway_booking_free', 'adrian_redirect_after_booking', 100, 4);
    add_action( 'eventorganiser_pre_gateway_booking_offline', 'adrian_redirect_after_booking', 100, 4);
    function adrian_redirect_after_booking( $booking_id, $booking, &$errors, $form ){
    
        $total_price = eo_get_booking_meta( $booking_id, 'booking_amount' );
        if ( 0 == $total_price ) {
                 eo_confirm_booking( $booking_id, true );
            }
    
         //Set redirect url and send them there
         $redirect = '';
         wp_redirect( $redirect );
         exit();
    }

    (A future update may well try to provide a ‘unified’ way of changing the gateway return url)

    Stephen Harris
    #9551

    Thank you very much Dario and Stephan – this works fine for me. It’s implemented and tested.

    Is there a chance that the redirect URL become a part of eo options? I can imagine that I’m not the only one who needs this functionality.

    Adrian Maleska
    #13283

    Update: 1.9.0 Will allow you to select a page to redirect the user to after the booking has been completed.

    Stephen Harris
    #28075

    Does the old pre_gateway-hooks still work?

    I cannot get it to redirect after signup, and I would like to redirect to a specific page.

    Veronika Nesverova
    #28080

    Yes they should still work.

    Feel free to open up a new thread and post the code you are using.

    Stephen Harris
Viewing 7 posts - 1 through 7 (of 7 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.