Version Description
(2022-10-27) = - Fixed an issue causing the duplicate booking error message in the front-end form to disappear.
Download this release
Release Info
Developer | Rustaurius |
Plugin | Restaurant Reservations |
Version | 2.5.18 |
Comparing to | |
See all releases |
Code changes from version 2.5.17 to 2.5.18
- assets/js/booking-form.js +29 -12
- readme.txt +8 -4
- restaurant-reservations.php +2 -2
assets/js/booking-form.js
CHANGED
@@ -9,6 +9,8 @@ jQuery(document).ready(function ($) {
|
|
9 |
*/
|
10 |
rtb_booking_form.init = function() {
|
11 |
|
|
|
|
|
12 |
// Scroll to the first error message on the booking form
|
13 |
if ( $( '.rtb-booking-form .rtb-error' ).length ) {
|
14 |
$('html, body').animate({
|
@@ -306,15 +308,18 @@ jQuery(document).ready(function ($) {
|
|
306 |
var data = jQuery.param( params );
|
307 |
jQuery.post( ajaxurl, data, function( response ) {
|
308 |
|
|
|
|
|
|
|
|
|
|
|
309 |
if ( ! response ) {
|
|
|
310 |
displayFieldError( 'date', rtb_booking_form_js_localize.error['smthng-wrng-cntct-us'] );
|
311 |
rtb_booking_form.timepicker.set( 'disable', true );
|
312 |
|
313 |
return;
|
314 |
}
|
315 |
-
else {
|
316 |
-
clearPrevFieldError( 'date' );
|
317 |
-
}
|
318 |
|
319 |
var additional_valid_times = jQuery.parseJSON( response );
|
320 |
|
@@ -333,15 +338,19 @@ jQuery(document).ready(function ($) {
|
|
333 |
}
|
334 |
|
335 |
if( !Array.isArray( additional_valid_times ) || 1 > additional_valid_times.length ) {
|
336 |
-
displayFieldError( 'time', rtb_booking_form_js_localize.error['no-slots-available'] );
|
337 |
-
}
|
338 |
-
// This "else" part hide the error printed server side before user can read the error
|
339 |
-
// There needs a method to delay the hide process if there is a server side error
|
340 |
-
else {
|
341 |
clearPrevFieldError( 'time' );
|
|
|
342 |
}
|
343 |
|
344 |
rtb_booking_form.timepicker.set( 'disable', all_valid_times );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
345 |
});
|
346 |
}
|
347 |
|
@@ -669,7 +678,7 @@ jQuery(document).ready(function ($) {
|
|
669 |
}
|
670 |
}
|
671 |
|
672 |
-
rtb_booking_form.update_possible_tables = function() {
|
673 |
|
674 |
if ( rtb_pickadate.enable_tables ) {
|
675 |
|
@@ -923,12 +932,20 @@ function displayFieldError( field, message ) {
|
|
923 |
}
|
924 |
|
925 |
function clearPrevFieldError( field ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
926 |
const fieldSelector = '.'+field;
|
927 |
var errorElms = jQuery('form.rtb-booking-form-form ' + fieldSelector + ' .rtb-error');
|
928 |
|
929 |
-
|
930 |
-
errorElms.each((idx, x) => x.remove());
|
931 |
-
}
|
932 |
}
|
933 |
|
934 |
// Functions for the 'View Bookings' shortcode
|
9 |
*/
|
10 |
rtb_booking_form.init = function() {
|
11 |
|
12 |
+
rtb_pickadate.init_complete = false;
|
13 |
+
|
14 |
// Scroll to the first error message on the booking form
|
15 |
if ( $( '.rtb-booking-form .rtb-error' ).length ) {
|
16 |
$('html, body').animate({
|
308 |
var data = jQuery.param( params );
|
309 |
jQuery.post( ajaxurl, data, function( response ) {
|
310 |
|
311 |
+
if( rtb_pickadate.init_complete ) {
|
312 |
+
clearPrevFieldError( 'date' );
|
313 |
+
clearPrevFieldError( 'time' );
|
314 |
+
}
|
315 |
+
|
316 |
if ( ! response ) {
|
317 |
+
clearPrevFieldError( 'date' );
|
318 |
displayFieldError( 'date', rtb_booking_form_js_localize.error['smthng-wrng-cntct-us'] );
|
319 |
rtb_booking_form.timepicker.set( 'disable', true );
|
320 |
|
321 |
return;
|
322 |
}
|
|
|
|
|
|
|
323 |
|
324 |
var additional_valid_times = jQuery.parseJSON( response );
|
325 |
|
338 |
}
|
339 |
|
340 |
if( !Array.isArray( additional_valid_times ) || 1 > additional_valid_times.length ) {
|
|
|
|
|
|
|
|
|
|
|
341 |
clearPrevFieldError( 'time' );
|
342 |
+
displayFieldError( 'time', rtb_booking_form_js_localize.error['no-slots-available'] );
|
343 |
}
|
344 |
|
345 |
rtb_booking_form.timepicker.set( 'disable', all_valid_times );
|
346 |
+
rtb_pickadate.init_complete = true;
|
347 |
+
})
|
348 |
+
.fail(function( args ) {
|
349 |
+
clearPrevFieldError( 'date' );
|
350 |
+
displayFieldError( 'date', rtb_booking_form_js_localize.error['smthng-wrng-cntct-us'] );
|
351 |
+
rtb_booking_form.timepicker.set( 'disable', true );
|
352 |
+
|
353 |
+
return;
|
354 |
});
|
355 |
}
|
356 |
|
678 |
}
|
679 |
}
|
680 |
|
681 |
+
rtb_booking_form.update_possible_tables = function() {
|
682 |
|
683 |
if ( rtb_pickadate.enable_tables ) {
|
684 |
|
932 |
}
|
933 |
|
934 |
function clearPrevFieldError( field ) {
|
935 |
+
if( field_has_error( field ) ) {
|
936 |
+
get_field_with_error( field ).each( (idx, x) => x.remove() );
|
937 |
+
}
|
938 |
+
}
|
939 |
+
|
940 |
+
function field_has_error( field ) {
|
941 |
+
return get_field_with_error( field ).length;
|
942 |
+
}
|
943 |
+
|
944 |
+
function get_field_with_error( field ) {
|
945 |
const fieldSelector = '.'+field;
|
946 |
var errorElms = jQuery('form.rtb-booking-form-form ' + fieldSelector + ' .rtb-error');
|
947 |
|
948 |
+
return errorElms;
|
|
|
|
|
949 |
}
|
950 |
|
951 |
// Functions for the 'View Bookings' shortcode
|
readme.txt
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
=== Five Star Restaurant Reservations - WordPress Booking Plugin ===
|
2 |
Contributors: FiveStarPlugins
|
3 |
Requires at Least: 5.0
|
4 |
-
Tested Up To: 6.
|
5 |
Tags: reservation, reservations, restaurant reservations, reservation form, restaurant booking, restaurant reservation form, restaurant booking form, restaurant booking system, reservation system, online reservations, online restaurant booking, dinner reservations, restaurant form, gutenberg reservations, gutenberg restaurant reservations, gutenberg restaurant booking, mobile reservations, responsive reservations, table reservations, open table, book table, reserve table, easy reservations, simple reservations, quick restaurant reservations, custom reservation form, custom restaurant reservations
|
6 |
-
Stable tag: 2.5.
|
7 |
License: GPLv3
|
8 |
License URI:http://www.gnu.org/licenses/gpl-3.0.html
|
9 |
Donate Link: https://www.etoilewebdesign.com/plugin-donations/
|
@@ -95,8 +95,9 @@ The ultimate version of the restaurant reservations plugin contains several powe
|
|
95 |
* <strong>Booking Deposits</strong>: Require a deposit, either per guest or per reservation, when someone makes a reservation to help prevent no-shows.
|
96 |
* Both Stripe and PayPal are available as payment gateways.
|
97 |
* Options to require deposit only for certain party sizes or only at certain times.
|
98 |
-
* <strong>Reservation Reminders</strong>: Send an SMS or email reminder message before a booking at a time that you specify (
|
99 |
-
* <strong>Late-Arrival Notices</strong>: Send an SMS or email message when a guest is late for their reservation by a specified amount of time.
|
|
|
100 |
|
101 |
[youtube https://www.youtube.com/watch?v=0DigZnw_3Qw]
|
102 |
|
@@ -259,6 +260,9 @@ Find answers to even more questions in the [FAQ](http://doc.fivestarplugins.com/
|
|
259 |
|
260 |
== Changelog ==
|
261 |
|
|
|
|
|
|
|
262 |
= 2.5.17 (2022-10-18) =
|
263 |
- Added an option to include a blank entry in the party size dropdown, so visitors are forced to make a selection, instead of it defaulting to 1.
|
264 |
- Updated the time display in the view bookings form to use the format specified in your WordPress general settings.
|
1 |
=== Five Star Restaurant Reservations - WordPress Booking Plugin ===
|
2 |
Contributors: FiveStarPlugins
|
3 |
Requires at Least: 5.0
|
4 |
+
Tested Up To: 6.1
|
5 |
Tags: reservation, reservations, restaurant reservations, reservation form, restaurant booking, restaurant reservation form, restaurant booking form, restaurant booking system, reservation system, online reservations, online restaurant booking, dinner reservations, restaurant form, gutenberg reservations, gutenberg restaurant reservations, gutenberg restaurant booking, mobile reservations, responsive reservations, table reservations, open table, book table, reserve table, easy reservations, simple reservations, quick restaurant reservations, custom reservation form, custom restaurant reservations
|
6 |
+
Stable tag: 2.5.18
|
7 |
License: GPLv3
|
8 |
License URI:http://www.gnu.org/licenses/gpl-3.0.html
|
9 |
Donate Link: https://www.etoilewebdesign.com/plugin-donations/
|
95 |
* <strong>Booking Deposits</strong>: Require a deposit, either per guest or per reservation, when someone makes a reservation to help prevent no-shows.
|
96 |
* Both Stripe and PayPal are available as payment gateways.
|
97 |
* Options to require deposit only for certain party sizes or only at certain times.
|
98 |
+
* <strong>Reservation Reminders</strong>: Send an <strong>SMS</strong> or email reminder message before a booking at a time that you specify (e.g. 4 hours before a reservation).
|
99 |
+
* <strong>Late-Arrival Notices</strong>: Send an <strong>SMS</strong> or email message when a guest is late for their reservation by a specified amount of time.
|
100 |
+
* <strong>Post-Reservation Follow-Up</strong>: Send a follow-up <strong>SMS</strong> or email message a specified amount of time after the reservation (e.g. 18 hours, 2 days, etc.). This can be used to get customer feedback, request a review, offer a promotion, or anything else!
|
101 |
|
102 |
[youtube https://www.youtube.com/watch?v=0DigZnw_3Qw]
|
103 |
|
260 |
|
261 |
== Changelog ==
|
262 |
|
263 |
+
= 2.5.18 (2022-10-27) =
|
264 |
+
- Fixed an issue causing the duplicate booking error message in the front-end form to disappear.
|
265 |
+
|
266 |
= 2.5.17 (2022-10-18) =
|
267 |
- Added an option to include a blank entry in the party size dropdown, so visitors are forced to make a selection, instead of it defaulting to 1.
|
268 |
- Updated the time display in the view bookings form to use the format specified in your WordPress general settings.
|
restaurant-reservations.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: Five Star Restaurant Reservations - WordPress Booking Plugin
|
4 |
* Plugin URI: http://www.fivestarplugins.com/plugins/five-star-restaurant-reservations/
|
5 |
* Description: Restaurant reservations made easy. Accept bookings online. Quickly confirm or reject reservations, send email notifications, set booking times and more.
|
6 |
-
* Version: 2.5.
|
7 |
* Author: FiveStarPlugins
|
8 |
* Author URI: https://profiles.wordpress.org/fivestarplugins/
|
9 |
* Text Domain: restaurant-reservations
|
@@ -39,7 +39,7 @@ class rtbInit {
|
|
39 |
public function __construct() {
|
40 |
|
41 |
// Common strings
|
42 |
-
define( 'RTB_VERSION', '2.5.
|
43 |
define( 'RTB_PLUGIN_DIR', untrailingslashit( plugin_dir_path( __FILE__ ) ) );
|
44 |
define( 'RTB_PLUGIN_URL', untrailingslashit( plugins_url( basename( plugin_dir_path( __FILE__ ) ), basename( __FILE__ ) ) ) );
|
45 |
define( 'RTB_PLUGIN_FNAME', plugin_basename( __FILE__ ) );
|
3 |
* Plugin Name: Five Star Restaurant Reservations - WordPress Booking Plugin
|
4 |
* Plugin URI: http://www.fivestarplugins.com/plugins/five-star-restaurant-reservations/
|
5 |
* Description: Restaurant reservations made easy. Accept bookings online. Quickly confirm or reject reservations, send email notifications, set booking times and more.
|
6 |
+
* Version: 2.5.18
|
7 |
* Author: FiveStarPlugins
|
8 |
* Author URI: https://profiles.wordpress.org/fivestarplugins/
|
9 |
* Text Domain: restaurant-reservations
|
39 |
public function __construct() {
|
40 |
|
41 |
// Common strings
|
42 |
+
define( 'RTB_VERSION', '2.5.18' );
|
43 |
define( 'RTB_PLUGIN_DIR', untrailingslashit( plugin_dir_path( __FILE__ ) ) );
|
44 |
define( 'RTB_PLUGIN_URL', untrailingslashit( plugins_url( basename( plugin_dir_path( __FILE__ ) ), basename( __FILE__ ) ) ) );
|
45 |
define( 'RTB_PLUGIN_FNAME', plugin_basename( __FILE__ ) );
|