Link to registration if the booking is only available for registred users

WordPress Event Management, Calendars & Registration Forums General Question Link to registration if the booking is only available for registred users

This topic contains 3 replies, has 2 voices, and was last updated by  Stephen Harris 9 years, 2 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #14842

    Hello,

    If I choose to allow bookings only for registred users, I need a link to allow them creating a new account. At this moment, it display the login feature, but not the registering feature. Could you help me doing this ?

    The automatic user account creation could fit to me except I would like to offer the possibility for the user to subscribe to the newsletter, which I can do with the built-in register system of WordPress.

    Thx

    Nicolas Massart
    #14843

    Hi Nicolas,

    The easiest way is probably to change the message that appears to logged-out users

    add_filter( 'eventorganiser_booking_login_required', 'my_login_required_message' );
    function my_login_required_message(){
        $register_link = site_url('/wp-login.php?action=register&redirect_to=' . get_permalink());
        return "<p>Only logged in users can place bookings, you can register <a href='".$register_link."'>here</a></p>
    }
    

    That can in a site utility plug-in (and although not recommended, a theme’s functions.php). Or you can edit the template eo-booking-form.php (after copying it to your theme).

    Stephen Harris
    #14850

    Thanks, it works, the correct code is this one :

    add_filter( 'eventorganiser_booking_login_required', 'my_login_required_message' );
    function my_login_required_message(){
        $register_link = site_url('/wp-login.php?action=register&redirect_to=' . get_permalink());
        return "<p>Only logged in users can place bookings, you can register <a href='".$register_link."'>here</a></p>";
    }
    
    Nicolas Massart
    #14867

    Ah, missing the ending quotation mark " – thanks for posting the update.

    Stephen Harris
Viewing 4 posts - 1 through 4 (of 4 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.