From 442ba8329664dab3991eef2baaab3b216bfa86b9 Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Mon, 14 Dec 2020 20:40:32 +0200 Subject: [PATCH] Display the please-select-time warning at the top of the available hours --- assets/js/frontend_book.js | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/assets/js/frontend_book.js b/assets/js/frontend_book.js index 15e2ea25..e2cba84d 100644 --- a/assets/js/frontend_book.js +++ b/assets/js/frontend_book.js @@ -249,28 +249,28 @@ window.FrontendBook = window.FrontendBook || {}; * Some special tasks might be performed, depending the current wizard step. */ $('.button-next').on('click', function () { - // If we are on the first step and there is not provider selected do not continue - // with the next step. + // If we are on the first step and there is not provider selected do not continue with the next step. if ($(this).attr('data-step_index') === '1' && !$('#select-provider').val()) { return; } - // If we are on the 2nd tab then the user should have an appointment hour - // selected. + // If we are on the 2nd tab then the user should have an appointment hour selected. if ($(this).attr('data-step_index') === '2') { if (!$('.selected-hour').length) { if (!$('#select-hour-prompt').length) { - $('#available-hours').append('

' - + '' - + EALang.appointment_hour_missing - + ''); + $('
', { + 'id': 'select-hour-prompt', + 'class': 'text-danger mb-4', + 'text': EALang.appointment_hour_missing, + }) + .prependTo('#available-hours'); } return; } } - // If we are on the 3rd tab then we will need to validate the user's - // input before proceeding to the next step. + // If we are on the 3rd tab then we will need to validate the user's input before proceeding to the next + // step. if ($(this).attr('data-step_index') === '3') { if (!validateCustomerForm()) { return; // Validation failed, do not continue. @@ -700,6 +700,9 @@ window.FrontendBook = window.FrontendBook || {}; $('#address').val(customer.address); $('#city').val(customer.city); $('#zip-code').val(customer.zip_code); + if (customer.timezone) { + $('#select-timezone').val(customer.timezone) + } var appointmentNotes = (appointment.notes !== null) ? appointment.notes : ''; $('#notes').val(appointmentNotes);