File tree 3 files changed +9
-3
lines changed
modules/hotelreservationsystem/controllers/admin
themes/hotel-reservation-theme
3 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -349,6 +349,11 @@ public function postProcess()
349
349
// max age of infant after which guest will considered as child // below 18
350
350
$ globalChildMaxAge = Tools::getValue ('WK_GLOBAL_CHILD_MAX_AGE ' );
351
351
$ globalMaxChildInRoom = Tools::getValue ('WK_GLOBAL_MAX_CHILD_IN_ROOM ' );
352
+ if (!Validate::isUnsignedInt ($ globalChildMaxAge )) {
353
+ $ this ->errors [] = $ this ->l ('Invalid value for "Consider guest as child below age". ' );
354
+ } else if ($ globalChildMaxAge <= 0 ) {
355
+ $ this ->errors [] = $ this ->l ('The value for "Consider guest as child below age" must be at least 1. ' );
356
+ }
352
357
353
358
// End occupancy fields validation
354
359
Original file line number Diff line number Diff line change 64
64
</div >
65
65
</div >
66
66
</div >
67
- <div class =" form-group col-sm-7 col-xs-6 occupancy_count_block" >
67
+ <div class =" form-group col-sm-7 col-xs-6 occupancy_count_block { if ! $ room_type_info [ ' max_children ' ] } hide { / if } " >
68
68
<div class =" row" >
69
69
<label class =" col-sm-12" >{ l s= ' Children' } </label >
70
70
<div class =" col-sm-12 clearfix" >
139
139
</div >
140
140
</div >
141
141
</div >
142
- <div class =" form-group col-sm-7 col-xs-6 occupancy_count_block" >
142
+ <div class =" form-group col-sm-7 col-xs-6 occupancy_count_block { if ! $ room_type_info [ ' max_children ' ] } hide { / if } " >
143
143
<div class =" row" >
144
144
<label class =" col-sm-12" >{ l s= ' Children' } </label >
145
145
<div class =" col-sm-12 clearfix" >
Original file line number Diff line number Diff line change @@ -241,6 +241,7 @@ $(document).ready(function(){
241
241
var roomBlockIndex = parseInt ( $ ( booking_occupancy_wrapper ) . find ( ".occupancy_info_block" ) . last ( ) . attr ( 'occ_block_index' ) ) ;
242
242
roomBlockIndex += 1 ;
243
243
244
+ var max_children = parseInt ( $ ( booking_occupancy_wrapper ) . find ( '.max_children' ) . val ( ) ) ;
244
245
245
246
var countRooms = parseInt ( $ ( booking_occupancy_wrapper ) . find ( '.occupancy_info_block' ) . length ) ;
246
247
countRooms += 1
@@ -269,7 +270,7 @@ $(document).ready(function(){
269
270
occupancy_block += '</div>' ;
270
271
occupancy_block += '</div>' ;
271
272
occupancy_block += '</div>' ;
272
- occupancy_block += '<div class="form-group col-sm-7 col-xs-6 occupancy_count_block">' ;
273
+ occupancy_block += '<div class="form-group col-sm-7 col-xs-6 occupancy_count_block ' + ( ! max_children ? 'hide' : '' ) + ' ">';
273
274
occupancy_block += '<div class="row">' ;
274
275
occupancy_block += '<label class="col-sm-12">' + children_txt + '</label>' ;
275
276
occupancy_block += '<div class="col-sm-12 clearfix">' ;
You can’t perform that action at this time.
0 commit comments