| @@ -208,9 +208,9 @@ | ||
| 208 | 208 | foreach ($settings['form_fields'] as $field) { |
| 209 | 209 | |
| 210 | 210 | $field_name = ''; |
| 211 | 211 | |
| 212 | - if(empty($field['field_id'])) { | |
| 212 | + if(!empty($field['field_id'])) { | |
| 213 | 213 | $field_name = $field['field_id']; |
| 214 | 214 | } |
| 215 | 215 | |
| 216 | 216 | if(empty($field_name)) { |
| @@ -273,17 +273,19 @@ | ||
| 273 | 273 | </a></div>'; |
| 274 | 274 | } else { |
| 275 | 275 | $calendar = $calendar[0]; |
| 276 | 276 | |
| 277 | - if(intval(wdk_get_option('wdk_bookings_max_guests')) > 0) { | |
| 277 | + if(!empty($calendar->guests)) { | |
| 278 | + $options = range(1, intval($calendar->guests)); | |
| 279 | + } elseif(intval(wdk_get_option('wdk_bookings_max_guests')) > 0) { | |
| 278 | 280 | $options = range(1, intval(wdk_get_option('wdk_bookings_max_guests'))); |
| 279 | - } else { | |
| 281 | + } else { | |
| 280 | 282 | $options = range(1, 10); |
| 281 | 283 | } |
| 282 | 284 | |
| 283 | 285 | if(empty($calendar->is_guests_disabled)) { |
| 284 | 286 | |
| 285 | - if($settings['booking_hide_count_childs_field'] != 'yes') { | |
| 287 | + if($settings['booking_hide_count_childs_field'] != 'yes' && !empty($calendar->is_children_acceptable) ) { | |
| 286 | 288 | $output ='<div class="elementinvader_addons_for_elementor_f_group elementinvader_addons_for_elementor_f_group_el_guests" style="width: 50%;-webkit-flex: 0 0 50%;flex: 0 0 50%;">'; |
| 287 | 289 | } else { |
| 288 | 290 | $output ='<div class="elementinvader_addons_for_elementor_f_group elementinvader_addons_for_elementor_f_group_el_guests" style="width: 100%;-webkit-flex: 0 0 100%;flex: 0 0 100%;">'; |
| 289 | 291 | } |
| @@ -299,9 +301,9 @@ | ||
| 299 | 301 | } |
| 300 | 302 | $output .='</select> |
| 301 | 303 | </div>'; |
| 302 | 304 | |
| 303 | - if($settings['booking_hide_count_childs_field'] != 'yes') { | |
| 305 | + if($settings['booking_hide_count_childs_field'] != 'yes' && !empty($calendar->is_children_acceptable)) { | |
| 304 | 306 | $output .='<div class="elementinvader_addons_for_elementor_f_group elementinvader_addons_for_elementor_f_group_el_guests" style="width: 50%;-webkit-flex: 0 0 50%;flex: 0 0 50%;">'; |
| 305 | 307 | $output .='<select name="guests_number_childs" id="guests_number_childs" type="select" class="elementinvader_addons_for_elementor_f_field" value="'.wmvc_show_data('guests_number', $_GET).'">'; |
| 306 | 308 | $output .= '<option value="">'.esc_html__('Childs','wpdirectorykit').'</option>'; |
| 307 | 309 | foreach ($options as $key => $option){ |
| @@ -381,9 +383,9 @@ | ||
| 381 | 383 | } |
| 382 | 384 | } |
| 383 | 385 | } |
| 384 | 386 | |
| 385 | - if ($settings['booking_hide_if_pets_allowed_field'] != 'yes') { | |
| 387 | + if ($settings['booking_hide_if_pets_allowed_field'] != 'yes' && wmvc_show_data('is_pets_acceptable',$calendar, false)) { | |
| 386 | 388 | $this->content ['wlisting_fields'] .='<div class="elementinvader_addons_for_elementor_f_group checkbox elementinvader_addons_for_elementor_f_group_el_pets" style="width: 100%;-webkit-flex: 0 0 100%;flex: 0 0 100%;"> |
| 387 | 389 | <label for="pets_allowed"> |
| 388 | 390 | <input name="pets_allowed" id="pets_allowed" type="checkbox" class="elementinvader_addons_for_elementor_f_field_checkbox" value="yes" placeholder="'.esc_attr__('Pets allowed', 'wpdirectorykit').'" > |
| 389 | 391 | '.esc_html__('Pets', 'wpdirectorykit').' |