| @@ -30,9 +30,11 @@ | ||
| 30 | 30 | // Check if Dynamic Form Field module is enabled (Pro feature) |
| 31 | 31 | $is_dynamic_form_enabled = apply_filters('yatra_dynamic_form_field_enabled', false); |
| 32 | 32 | |
| 33 | 33 | // Get form configuration - returns default config if module disabled, custom config if enabled |
| 34 | -$form_config = yatra_get_booking_form_config(); | |
| 34 | +// Scoped to the trip being booked, so a field or section limited to certain | |
| 35 | +// trips (Pro) is neither rendered nor required here. | |
| 36 | +$form_config = yatra_get_booking_form_config(!empty($trip_id) ? (int) $trip_id : null); | |
| 35 | 37 | |
| 36 | 38 | |
| 37 | 39 | // Country list — pulls from the canonical FormatHelper source so every |
| 38 | 40 | // dropdown (admin, public booking, Pro modules) shows the same full |
| @@ -144,10 +146,17 @@ | ||
| 144 | 146 | <?php |
| 145 | 147 | break; |
| 146 | 148 | |
| 147 | 149 | case 'country': |
| 150 | + // Flag base is handed to the field (same contract as the phone | |
| 151 | + // widget) so country-select.js can build flag URLs without | |
| 152 | + // knowing the plugin URL. The select still renders and submits | |
| 153 | + // normally — the widget is a progressive enhancement over it. | |
| 154 | + $country_flag_base = \defined('YATRA_PLUGIN_URL') ? YATRA_PLUGIN_URL . 'assets/img/flags/' : ''; | |
| 148 | 155 | ?> |
| 149 | - <select id="<?php echo $field_id; ?>" name="<?php echo $field_name; ?>" <?php echo $required_attr; ?>> | |
| 156 | + <select id="<?php echo $field_id; ?>" name="<?php echo $field_name; ?>" <?php echo $required_attr; ?> | |
| 157 | + data-yatra-country-select | |
| 158 | + data-flag-base="<?php echo esc_url($country_flag_base); ?>"> | |
| 150 | 159 | <option value=""><?php echo esc_html(yatra_translate_form_string($field['placeholder'] ?? '') ?: __('Select Country', 'yatra')); ?></option> |
| 151 | 160 | <?php foreach ($countries as $code => $name) : ?> |
| 152 | 161 | <option value="<?php echo esc_attr($code); ?>" <?php echo selected($prefill_value, (string) $code, false); ?>> |
| 153 | 162 | <?php echo esc_html($name); ?> |
| @@ -681,8 +690,11 @@ | ||
| 681 | 690 | 'deposit_required' => $deposit_required, |
| 682 | 691 | 'deposit_percentage' => $deposit_percentage, |
| 683 | 692 | 'partial_payment' => $partial_payment, |
| 684 | 693 | 'partial_payment_percentage' => $partial_payment_percentage, |
| 694 | + // Tour start (when a date is already chosen) → Pro hides deposit/partial for | |
| 695 | + // tour-anchored payments when the tour is inside the balance-due window. | |
| 696 | + 'travel_date' => isset($booking->travel_date) ? (string) $booking->travel_date : '', | |
| 685 | 697 | ]); |
| 686 | 698 | |
| 687 | 699 | $has_flexible_options = $flexible_payments_enabled && !empty($payment_method_options); |
| 688 | 700 | ?> |
| @@ -880,8 +892,9 @@ | ||
| 880 | 892 | <label for="account_password"> |
| 881 | 893 | <?php esc_html_e('Password', 'yatra'); ?> <span class="required">*</span> |
| 882 | 894 | </label> |
| 883 | 895 | <input type="password" id="account_password" name="account_password" minlength="8" |
| 896 | + autocomplete="new-password" | |
| 884 | 897 | placeholder="<?php esc_attr_e('Minimum 8 characters', 'yatra'); ?>"> |
| 885 | 898 | </div> |
| 886 | 899 | <div class="yatra-form-group yatra-field-half"> |
| 887 | 900 | <label for="account_password_confirm"> |
| @@ -887,8 +900,9 @@ | ||
| 887 | 900 | <label for="account_password_confirm"> |
| 888 | 901 | <?php esc_html_e('Confirm Password', 'yatra'); ?> <span class="required">*</span> |
| 889 | 902 | </label> |
| 890 | 903 | <input type="password" id="account_password_confirm" name="account_password_confirm" minlength="8" |
| 904 | + autocomplete="new-password" | |
| 891 | 905 | placeholder="<?php esc_attr_e('Re-enter password', 'yatra'); ?>"> |
| 892 | 906 | </div> |
| 893 | 907 | </div> |
| 894 | 908 | <p class="yatra-field-hint" style="font-size: 13px; color: #6b7280; margin-top: 8px;"> |