[Events +] Terms of Service

Hi there,
My client want to make sure that all attendees accept the terms before they can RSVP. They want a checkbox and a text like 'Yes, I accept <link:terms of service>!' that has to be checked before the 'Attend' (norwegian: 'Meld meg på!') button is activated.

Image in NeXT post :slight_smile:

Espen

  • Adam Czajczyk
    • Support Gorilla

    Hello espsjurs

    I hope you're well today and thank you for your question!

    Currently this is not supported by the Events+ plugin and it would require some additional code. I have asked our developers if they could help with that so they'll look into it and let us know here whether it would be possible to add some sort of an additional code that could do this.

    Please keep track of this ticket and we'll update you here as soon as possible.

    Kind regards,
    Adam

  • Konstantinos Xenos
    • Rubber Duck Debugger

    Hi espsjurs !

    I've created a mu-plugin to help out with this. Please make sure to have a backup before editing / altering files or adding custom code to your site for safekeeping.

    To install it you can download the attached .zip and you'll find a .php file inside. You'll have to upload that to your wp-content/mu-plugins directory ( if the mu-plugins doesn't exist you can create it ). The final path should look like this :
    wp-content/mu-plugins/events-accept-before-rsvp.php

    The only thing that you will have to edit is the <label> so you can change the Yes, I accept the Terms of Service. text and href link to anything you like. You can find it at Line 19.

    Preview of the code for explanation purposes: https://gist.github.com/wpmudev-sls/f2b8af2ca9c7706abcdff559183cc8cb

    What this does in general. It adds a 'disabled' class on the "I'm Attending" buttons so you can style them more if you like and disables them from clicks. It also adds a checkbox before with the text that you'll input. As soon as you 'check' the checkbox the "disabled" class gets removed so the button works normally again.

    I hope this helps!

    Regards,
    Konstantinos

  • espsjurs
    • The Incredible Code Injector

    Hi again,

    Got it to work :slight_smile:

    Added input. the same way you set up a. like this:

    <style>
    	a.wpmudevevents-yes-submit.disabled {
    		pointer-events: none;
    		cursor: default;
    	}
    	input.wpmudevevents-yes-submit.disabled {
    	pointer-events: none;
    	cursor: default;
    	}
    	</style>

    and this:

    <script>
    	( function ( $ ) {
    		$( document ).ready( function() {
    			$( 'a.wpmudevevents-yes-submit' ).addClass( 'disabled' );
    			$( 'input.wpmudevevents-yes-submit' ).addClass( 'disabled' );
    			$( 'a.wpmudevevents-yes-submit').on( 'click', function( e ) {
    				if ( $( this ).hasClass( 'disabled' ) ) {
    					e.preventDefault();
    				}
    			});
    			$( 'input.wpmudevevents-yes-submit').on( 'click', function( e ) {
    				if ( $( this ).hasClass( 'disabled' ) ) {
    					e.preventDefault();
    				}
    			});
    			$( 'input.rsvpaccept').on( 'click', function( e ) {
    				if ( $( this ).is( ':checked' ) ) {
    					$( this ).parent().siblings( 'a.wpmudevevents-yes-submit' ).removeClass( 'disabled' );
    					$( this ).parent().siblings( 'input.wpmudevevents-yes-submit' ).removeClass( 'disabled' );
    				} else {
    					$( this ).parent().siblings( 'a.wpmudevevents-yes-submit' ).addClass( 'disabled' );
    					$( this ).parent().siblings( 'input.wpmudevevents-yes-submit' ).addClass( 'disabled' );
    				}
    			});
    		});
    	} ( jQuery ) );
    	</script>

    Works Perfect!
    Thanks !

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.