diff --git a/modules/hotelreservationsystem/controllers/admin/AdminHotelGeneralSettingsController.php b/modules/hotelreservationsystem/controllers/admin/AdminHotelGeneralSettingsController.php index f75670fd7..f105d2420 100644 --- a/modules/hotelreservationsystem/controllers/admin/AdminHotelGeneralSettingsController.php +++ b/modules/hotelreservationsystem/controllers/admin/AdminHotelGeneralSettingsController.php @@ -349,6 +349,11 @@ class AdminHotelGeneralSettingsController extends ModuleAdminController // max age of infant after which guest will considered as child // below 18 $globalChildMaxAge = Tools::getValue('WK_GLOBAL_CHILD_MAX_AGE'); $globalMaxChildInRoom = Tools::getValue('WK_GLOBAL_MAX_CHILD_IN_ROOM'); + if (!Validate::isUnsignedInt($globalChildMaxAge)) { + $this->errors[] = $this->l('Invalid value for "Consider guest as child below age".'); + } else if ($globalChildMaxAge <= 0) { + $this->errors[] = $this->l('The value for "Consider guest as child below age" must be at least 1.'); + } // End occupancy fields validation diff --git a/themes/hotel-reservation-theme/_partials/occupancy_field.tpl b/themes/hotel-reservation-theme/_partials/occupancy_field.tpl index 1ffa6f022..9b9c77142 100644 --- a/themes/hotel-reservation-theme/_partials/occupancy_field.tpl +++ b/themes/hotel-reservation-theme/_partials/occupancy_field.tpl @@ -64,7 +64,7 @@ -
+
@@ -139,7 +139,7 @@
-
+
diff --git a/themes/hotel-reservation-theme/js/occupancy.js b/themes/hotel-reservation-theme/js/occupancy.js index 031a37904..b292e430c 100644 --- a/themes/hotel-reservation-theme/js/occupancy.js +++ b/themes/hotel-reservation-theme/js/occupancy.js @@ -241,6 +241,7 @@ $(document).ready(function(){ var roomBlockIndex = parseInt($(booking_occupancy_wrapper).find(".occupancy_info_block").last().attr('occ_block_index')); roomBlockIndex += 1; + var max_children = parseInt($(booking_occupancy_wrapper).find('.max_children').val()); var countRooms = parseInt($(booking_occupancy_wrapper).find('.occupancy_info_block').length); countRooms += 1 @@ -269,7 +270,7 @@ $(document).ready(function(){ occupancy_block += '
'; occupancy_block += '
'; occupancy_block += '
'; - occupancy_block += '
'; + occupancy_block += '
'; occupancy_block += '
'; occupancy_block += ''; occupancy_block += '
';