Hide worker choice, display all available slots
Hi Nikola,
is there a way to display all available time slots without requiring the customer to choose a worker first?
In our setup, there is only one service and it really doesn't matter which worker performs it. If there are multiple workers per slot then random assignment would be ideal.
Thank you for your advice.
Max Heise
In our setup, there is only one service and it really doesn't matter which worker performs it. If there are multiple workers per slot then random assignment would be ideal.
Thank you for your advice.
Max Heise
Please login or Register to submit your answer
Also: We would be willing to pay a reasonable fee/get the extension package for this additional functionality.
One way to go would be to offer an “any” option in the Worker drop down menu resulting in some kind of wildcard sql query (e.g., “worker LIKE ‘%'” in WHERE clause…) Any help/pointers?
Quick fix. Put it in your functions.php. This will select the last available worker after selecting the location. The if clause must be changed to your desires.
add_action(‘wp_footer’, ‘appointments_js’);
function appointments_js(){
if(get_the_id()==YOUR_PAGE_ID_WHERE_YOU_USE_EA) {
$output =<<<EOF
jQuery(document).ready(function($){
$(‘select[name=”location”]’).change(function(e) {
setTimeout (function() {
$(‘select[name=”worker”]’)
.find(‘option:last-child()’)
.prop(‘selected’,true)
.trigger(‘change’);
},1000);
});
});
EOF;
echo $output;
}
}