Identification before booking with appointment +

Hello,

First of all, sorry for the mistakes, i'm french

So....
I'm using appointments+ and i love it. A few job as been done on "mine" by some of the staff of WPMU and i thank you again for this.

I'd like to "protect" the appointment system so that not every one can book. I've seen that it's possible with the plugin but i didn't understand well how does it work and how to configurate it.

What i need is that people who want to book have a password that i gave them.
i guess i should use for that the "wordpress identification", right? so..... do i need to create for each client a "user profil"? i would prefer not.
what can you suggest, please?
Thank you
Mathieu

  • Vaughan

    Hi @matthieu,

    the best way of doing this is to register each user as a member on the site, so they have their own login credentials, then you can set the permissions of appointments+ to members only.

    You could perhaps protect the whole page with a password, using wordpress default password function when editing the appointment page.

    select visibility in the post publishing meta box in right column, then select password protect.

    However, this would probably work ok, but offers no protection against people giving the password to other people, so a user account is always preferable.

    Hope this helps

  • Ash

    Hello @Mathieu

    I hope you are well today.

    In that case, please create a new additional field called - Password. Then add the following code:

    add_filter( 'app_footer_scripts', 'app_footer_scripts_cb' );
    function app_footer_scripts_cb( $script ){
    	$sc = '$(".appointments-confirmation-button").click(function(){
    		if($(".appointments-password-field-entry").val() == "")
    		{
    			alert("Please give password.");
    			return false;
    		}
    		if($(".appointments-password-field-entry").val() != "XXXX")
    		{
    			alert("Please give a correct password.");
    			return false;
    		}
    	';
    	return str_replace( '$(".appointments-confirmation-button").click(function(){', $sc, $script );
    }

    You need to change XXXX to your desired password.

    You can add those codes in your functions.php in the theme, if you think your theme won’t be changed. Otherwise mu-plugins is the best solution. To use mu-plugins, go to /wp-content/ and find the folder with name 'mu-plugins'. If there is no folder in that name, then create a folder, name it 'mu-plugins', create a file inside that, give any name you like and paste the code in there. You don't need to activate that plugin. Mu-plugins means must use plugins, so it will be activated automatically always. If you use mu-plugins then add a php start tag at the beginning of the code.

    Hope it helps :slight_smile: Please feel free to ask more question if you have.

    Cheers
    Ash

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.