Best configuration for tennis court

Hello

I have to configure Appointment+ for a booking system of tennis courts for a sport center.
This sport center has 4 courts and the requirements are:

1) Change cost of the tennis court relative to time. Of evening is 20€ per/h, morning is 15€ per/h.

2) Keep unavailable a specific court in a specific time of a day of the week during a month or during a year

3) Some tennis courts, in a specific day of the week are available for slot of half hour (9:30am-10:30am, 10:30am-11:30am, and so on...) and other days instead available for full hours (9:00am-10:00am, 10:00am-11:00am, and so on...)
In these case the booking can be made for 90 minutes.

I've some doubts about configuration. These are my questions:

1) Each tennis court must be service provider? Is not possible show all service providers in only one view and allow user to change the date? Like this layout:
https://premium.wpmudev.org/forums/?bb_attachments=880349&bbat=64921&inline

2) Have I to create more services for change of the cost of tennis court (price morning / price evening) ? (Is not possible to show in only one view like before?)

3) Is it possible to set read-only or hide "user name” and "phone number" in screen booking? (I attach screenshot here)

4) How can I make available the booking of 90 minutes? I’ve to make still more services for each service provider?

Thank you so much!
Claudio

  • Adam Czajczyk

    Hello Claudio,

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

    1) Each tennis court must be service provider? Is not possible show all service providers in only one view and allow user to change the date? Like this layout:
    https://premium.wpmudev.org/forums/?bb_attachments=880349&bbat=64921&inline

    Each court should be a service (not a service provider). Users would be then able to choose which court would they like to book. The plugin however does not support a view such as shown on an image that you attached to your post.

    I suppose this could be achieved but it would require a custom coded booking calendar so you may want to post a question about it on our "Jobs & Pros" job board (please note: no WPMU DEV staff involved!) here:

    https://premium.wpmudev.org/wordpress-development/

    2) Have I to create more services for change of the cost of tennis court (price morning / price evening) ? (Is not possible to show in only one view like before?)

    In order to set different prices for the same court the court should be assigned multiple service providers. For example: a court "A" would cost $1 between 9am and 1pm and $2 between 1pm and 5pm. To achieve this you would want to create two service providers and then:

    - set working hours 9am - 1pm for provider 1
    - set working hours 1pm to 5pm for provider 2
    - set price for service A as $1
    - don't set "additional price" for provider 1
    - set additional $1 (that would give in total $2 = service price + service provider additional price) for provider 2.

    As a result, all bookings for that court (service A) would go to the service provider 1 between 9am and 1pm and cost $1 and all bookings between 1pm and 5pm would go to service provider 2 and cost total $2.

    The same rule would apply to other three courts.

    3) Is it possible to set read-only or hide "user name” and "phone number" in screen booking? (I attach screenshot here)

    Will the system accept bookings only from registered/logged in user or should it be "open" for everyone?

    4) How can I make available the booking of 90 minutes? I’ve to make still more services for each service provider?

    If there are going to be only 90 minutes bookings available then you can simply set a service duration to 90 minuts. However, if you are going to offer different length bookings (e.g. 60 and 90 minutes to choose from) you should create two services for the same court.

    2) Keep unavailable a specific court in a specific time of a day of the week during a month or during a year

    This can be achieved by setting "Exception" ("Appointments -> Settings -> Exceptions") for a relevant service provider. Sticking to an example above: if you wanted to make court A unavailable on Dec 11th you would set "Exception" for service provider 1 and service provider 2 for that date.

    Exceptions however work for entire days/periods. If you wish to keep the court unavailable for a specific booking slot(s) you may simply book it as an admin.

    If you have further questions on this, let me know please.

    Best regards,
    Adam

  • Claudio

    Hello Adam
    Thanks for your attention

    1) Why you say to set a tennis court like a service but instead in this post Patrick says to set like a service provider and set service like slot time?
    https://premium.wpmudev.org/forums/topic/appointments-for-tennis-court-booking

    2) The plugin however does not support a view such as shown on an image that you attached to your post.

    I'm a web developer and I know PHP, HTML, and JS. There is a technical support service in wpmudev? There is a technical guide?

    3)

    Will the system accept bookings only from registered/logged in user or should it be "open" for everyone?

    Yes the system accept only bookyng from register/logged user?

    4)

    This can be achieved by setting "Exception" ("Appointments -> Settings -> Exceptions") for a relevant service provider. Sticking to an example above: if you wanted to make court A unavailable on Dec 11th you would set "Exception" for service provider 1 and service provider 2 for that date.
    Exceptions however work for entire days/periods. If you wish to keep the court unavailable for a specific booking slot(s) you may simply book it as an admin.

    It's very boring for admin insert books for each 2 tennis court for each slot from 4:00pm to 8:00pm for 12 months. Doesn't exsist a fast way?
    I was thinking that maybe the working time page could helps me but only if I set a tennis court like a service provider.

    5)

    If there are going to be only 90 minutes bookings available then you can simply set a service duration to 90 minuts. However, if you are going to offer different length bookings (e.g. 60 and 90 minutes to choose from) you should create two services for the same court.

    The 90 minutes tennis court are available only Monday only for tennis court 1 and 2, not for 3 and 4.

    Definitely if I set a tennis court like a service my best configuration is:

    Service A: Court 1 - 60min
    Service B: Court 1 - 90min
    Service C: Court 2 - 60min
    Service D: Court 2 - 90min
    Service E: Court 3 - 60min
    Service F: Court 3 - 90min
    Service G: Court 4 - 60min
    Service H: Court 4 - 90min

    Service Provider 1: Mornign, 9am - 12pm, 10$
    Service Provider 2: Afternoon, 12pm - 6pm, +2$
    Service Provider 3: Mornign, 6pm - 9pm, +2$

    After I insert booking with admin user for Service A, B, C, D to set unavailable these court from 4pm to 9pm for 12 month. How can I insert rapidly?

    Thank you so much!
    Best
    Claudio

  • Adam Czajczyk

    Hello Claudio,

    Thank you for your replay!

    1) Why you say to set a tennis court like a service but instead in this post Patrick says to set like a service provider and set service like slot time?
    https://premium.wpmudev.org/forums/topic/appointments-for-tennis-court-booking

    I checked Patrick's post and he suggested the same way as I did. He specifically said "services", note this please:

    If you want your users to be able to book a court for 60 or 90 minutes, then set up your services like that. So you would have 4 services users could book

    I'm a web developer and I know PHP, HTML, and JS. There is a technical support service in wpmudev? There is a technical guide?

    There's no specific "tech guide/docs" for Appointments+ but if you feel like writing any "extension code" for it please feel free to ask any questions on this and I'll do my best to address all your concerns on this. If necessary, I'll consult developers.

    It's very boring for admin insert books for each 2 tennis court for each slot from 4:00pm to 8:00pm for 12 months. Doesn't exsist a fast way?
    I was thinking that maybe the working time page could helps me but only if I set a tennis court like a service provider.

    Assuming that this court unavailability is "recurring" there's another way. The simplest solution is to just set working hours for related service provider the way the given court would be not available for booking. For example: court A is assigned to the service provider 2 between 1pm and 10pm but it shouldn't be available every friday between 4pm and 8pm.

    In this case you may set working hours for service provider 2 from 1pm to 5pm and set a "break" on Fridays between 4pm and 8pm.

    The 90 minutes tennis court are available only Monday only for tennis court 1 and 2, not for 3 and 4.

    Definitely if I set a tennis court like a service my best configuration is:

    Service A: Court 1 - 60min
    Service B: Court 1 - 90min
    Service C: Court 2 - 60min
    Service D: Court 2 - 90min
    Service E: Court 3 - 60min
    Service F: Court 3 - 90min
    Service G: Court 4 - 60min
    Service H: Court 4 - 90min

    Service Provider 1: Mornign, 9am - 12pm, 10$
    Service Provider 2: Afternoon, 12pm - 6pm, +2$
    Service Provider 3: Mornign, 6pm - 9pm, +2$

    That seem right. Services are set properly and service providers as well. For making selected court unavailable in certain periods see my answer above.

    However, in this case you may need to set additional service providers because working hours and breaks affect service provider and as a result all services given service provider offers. It may be necessary then to "double" some of these service providers (most likely those with "breaks") and then use "capacity" option to limit number of possible simultaneous bookings.

    I'd suggest setting it all the way you described above first and then test/check how does it work for you and what options/possibilities/schedule changes should be further implemented. I'd then check the setup and I'd assist you with this if needed.

    Yes the system accept only bookyng from register/logged user?

    About "Name" and "Phone" fields: you may remove them with plugin's settings. To do this, please go to the "Appointments -> Settings -> General -> Display" page and un-check the checkboxes for "Name" and "Phone" in "Require these from the client:" option.

    Best regards,
    Adam

  • Claudio

    Hello Adam
    thanks for your support.

    Probably I've a configuration mistake.
    I setted the configuration like we said but it seems that somethings does not work.
    For a correct understanding I invite you to visit this
    http://www.impiantisportivipescantina.com/prenotazione-campi/

    Like you see we have 2 services providers: "Sera from 18pm to 22pm" and another one "Sera from 20pm to 22pm".
    I add the first one to tennis court 3 and 4 and the second one for court 1 and 2.
    When I select a tennis court (our service combo) on the left the combo of service provider, on the right, it's not correct because it contains always "Sera from 20pm to 22pm". This is wrong because it should contain "Sera from 18pm to 22pm"

    Where I'm making the mistake of configuration?

    Thank you!

  • Adam Czajczyk

    Hello Claudio!

    Thank you for your response!

    I'd like to take a closer look at your Appointments+ configuration. I could do this by accessing the site using a "support access" feature of the WPMU DEV Dashboard plugin. You can grant me a support access to the site by following this guide:

    https://premium.wpmudev.org/manuals/wpmu-dev-dashboard-enabling-staff-login/

    Let me know when you're ready with this, please :slight_smile:

    Best regards,
    Adam

  • Predrag Dubajic

    Hi Claudio,

    Apologies for the delay here, we were doing some extensive testing as it's kinda weird issue and I was actually able to replicate it on one of my installations during this testings so I have created bug report and forwarded it to my developers.

    What did work for me was downgrading plugin version to 1.9.1, setting up provider and services and then updating back to latest version.
    Can you please try that and see if it works for you as well?

    You can click on changelog link on plugin page and there you will see download link next to version number: https://premium.wpmudev.org/project/appointments-plus/

    Let us know how it goes.

    Best regards,
    Predrag

  • Claudio

    Hello Predrag
    Thank you for support.

    Unfortunately it doesn't works.

    I follow your steps:
    1) Delete Service, Service Provider (and users)
    2) Downgrade to 1.9.1.
    3) Create and setup: Service, Service Provider (and users),
    4) Upgrade to 1.9.3

    After this sequence of steps the problem still exists.
    The service provider not change in relation to service.
    Let me know if there are more ways to resolve the problem or if developers have fixed the bug.

    Best
    Claudio

  • Panos

    Hi Claudio ,

    I can't replicate this in any of my installations. I would need to have a closer look on this issue, could you please send us ftp and admin credentials? You can send that privately through our contact form: https://premium.wpmudev.org/contact/

    Select "I have a different question?" for your topic - this and the subject line ensure that it gets assigned to me.

    Send in:Subject: "Attn: Panos Lyrakis"

    - Admin login:
    Admin username
    Admin password
    Login url

    - FTP credentials
    host
    username
    password
    (and port if required)

    - link back to this thread for reference
    - any other relevant urls

    Thanks!
    Panos

  • Predrag Dubajic

    Hi Claudio,

    There are some strange things happening with this issue, after I did the downgrade of the plugin and it worked for me I can no longer replicate it on that installation even if I reinstall the plugin and my other installations are not having this issue.

    Because of this it's hard to determine what exactly is causing this issue but I can confirm that Panos received your message and is trying to figure it out.

    Best regards,
    Predrag

  • Panos

    Hi Claudio!

    Could you please create a new admin account and send login credentials. I can't login to your admin with the login details you sent, and there's a message saying only two attempts remaining, so I don't want to lock you out :slight_smile:

    Also check that the security plugin you are using doesn't block any ips or countries etc. I could login through ftp fine though!

    Thanks!
    Panos

  • Claudio

    Hello Panos!
    Your fix works! Thanks!

    Only some questions:
    1) My short code is: [app_schedule ... require_provider="1" require_service="1"]
    But I see always the schedule table, when the service provider is not setted too. Why?
    With this short code I should see the schedule table only when service and service provider are selected...

    2) I need to insert a specific cost for Saturday, Sunday and other holidays (christmas, easter, etc etc). How can I set my configuration for this feature? I have to create a new Service Provider?

    I have just enabled the "support access"

    Thank you so much!
    Claudio

  • Panos

    Hey Claudio ,

    Glad it works :slight_smile:

    1. By default it will use the current date and the first service and service provider. You can enable the "Default Service" from Appointments > Settings > Add-ons tab if you need to choose a default service other than the first defined one.

    2. You can create a new provider, but it will be pretty messy, as you need to set the Exception dates for this provider in order not to be available in dates other than the holidays, also current providers should not be available during holidays. In this case you can use the following snipped as you guide. Paste it in your child theme's functions.php file:

    function wpmudev_app_pre_confirmation_price( $price, $service, $worker, $start, $end ){
    
    	if( $start >= strtotime("15 December 2016") && $start <= strtotime("15 January 2017") ){
    
    		if( $service == 1 ){ //Price for service with id 1
    
    			$price = 18.49;
    
    		}
    
    		if( $service == 24 ){ //Price for service with id 24
    
    			$price = 42.49;
    
    		}
    
    	}
    
    	return $price;
    
    }
    
    add_filter( 'app_pre_confirmation_price', 'wpmudev_app_pre_confirmation_price', 10, 5 );

    This snipped checks if the date is between "15 December 2016" and "15 January 2017", so you first might need to change these dates.

    It also sets different price per service. So in the sample code I check if service id is 1 and 24. In case you feel this is out of your comfort zone please let me know if you need different prices per service, and if so, which are the service ids and the prices you need to be set for them so I can provide a new snippet.

    Thanks!
    Panos

  • Claudio

    Hello Panos ,
    Thanks for you support!

    1. I activated "Default Service" add on, but I still see the table schedule when the service provider is not selected. Propably I didn' t understand how it works. Can you support me?
    http://www.impiantisportivipescantina.com/prenotazione-campi/

    2. Can you set a snippet with different price
    - for every saturday and sunday,
    - for 1st january and 2nd june

    Thanks a lot!
    Claudio

  • Panos

    Hey Claudio ,

    1. You haven't done anything wrong :slight_smile: This is how A+ is designed. For this please use the following in your functions.php:

    function wpmudev_apps_hide_cal_css(){
    	if( !isset( $_GET['app_provider_id'] ) ):
    	?>
    	<style>
    	.appointments-wrapper,
    	.appointments-legend,
    	.appointments-pagination{
    		display: none;
    	}
    	</style>
    	<?php
    	endif;
    }
    
    add_action( 'wp_head', 'wpmudev_apps_hide_cal_css' );

    2. As for prices please try out the following snippet:

    function wpmudev_app_pre_confirmation_price( $price, $service, $worker, $start, $end ){
    
    	if( date('D', $start) === 'Sat' || date('D', $start) === 'Sun' ) $price = 39.99;
    	//if( date( 'd-m-Y', $start ) == '01-01-2017' || date( 'd-m-Y', $start ) == '01-06-2017' ) $price = 34.99;
    	if( date( 'd-m', $start ) == '01-01' || date( 'd-m', $start ) == '01-06' ) $price = 34.99;
    
    	return $price;
    
    }
    
    add_filter( 'app_pre_confirmation_price', 'wpmudev_app_pre_confirmation_price', 10, 5 );

    If you want for 1st January of 2017 only and 1st june 2017, please comment/ remove line
    if( date( 'd-m', $start ) == '01-01' || date( 'd-m', $start ) == '01-06' ) $price = 34.99;
    and uncomment the line above that.

    Cheers!
    Panos

  • Claudio

    Hello Panos ,
    thanks a lot! Your snippet works fine!
    Just a little case that you can also try on web site:
    http://www.impiantisportivipescantina.com/prenotazione-campi/

    For right menu leave "Campo 3" and use right select menu and select "Pomeriggio 12pm - 18pm".
    After select "Campo Sintetico - Coperto". In this way the page refresh the select right menu is empty ("Seleziona orario") but the schedule table is visible. Is it possible to hide it?

    Thank you so much Panos!

  • Panos

    Hi Claudio ,

    Good catch :slight_smile:

    This happens because the provider set in the query var doesn't provide the service selected.

    The quickest and easiest way in my opinion would be to hide the calendar and then use some js to make it visible if there is a provider chosen in the providers select dropdown.

    If you agree, replace the code for hiding the calendar I provided in part 1 of my previous reply with this:

    function wpmudev_apps_hide_cal_css(){
    	//if( !isset( $_GET['app_provider_id'] ) ):
    	?>
    	<style>
    	.appointments-wrapper,
    	.appointments-legend,
    	.appointments-pagination{
    		display: none;
    	}
    	</style>
    	<?php
    	//endif;
    }
    
    add_action( 'wp_head', 'wpmudev_apps_hide_cal_css' );

    It now hides the calendar every time, even if provider id exists in query var.

    Then add the following snippet which contains the js that checks if the providers select has any provider chosen:

    function wpmudev_apps_hide_cal_js(){
    	?>
    	<script type="text/javascript">
    	(function($){
    		if( $( '.app_select_workers' ).val() != 0 ) {
    			$( '.appointments-wrapper,.appointments-legend,.appointments-pagination' ).fadeIn( 300 );
    		}
    	})(jQuery);
    	</script>
    	<?php
    }
    
    add_action( 'wp_footer', 'wpmudev_apps_hide_cal_js' );

    Please let me know how this works for you!

    Thanks!

  • Panos

    Hey Claudio ,

    You need to add the following snipped in your functions.php which stores that price in the database:

    function wpmudev_appointments_insert_appointment_args( $args ){
    
    	if( isset( $args['date'] ) ){
    
    		$start = $args['date'];
    
    		if( date('D', $start) === 'Sat' || date('D', $start) === 'Sun' ) $args['price'] = 39.99;
    		//if( date( 'd-m-Y', $start ) == '01-12-2016' || date( 'd-m-Y', $start ) == '01-06-2017' ) $price = 34.99;
    		if( date( 'd-m', $start ) == '01-12' || date( 'd-m', $start ) == '01-06' ) $args['price'] = 34.99;
    
    	}
    
    	return $args;
    
    }
    
    add_filter('appointments_insert_appointment_args', 'wpmudev_appointments_insert_appointment_args');

    Cheers!
    Panos

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.