vmn Posted October 14, 2018 Share Posted October 14, 2018 The function tep_draw_pull_down_menu should be fixed as well: find: if (tep_not_null($parameters)) $field .= ' ' . $parameters; replace with: if (tep_not_null($parameters)) { if (strpos($parameters, 'required') !== false) { $parameters .= ' oninvalid="this.setCustomValidity(\'' . FORM_INPUT_VALUE_MISSING. '!\')" onchange="this.setCustomValidity(\'\')"'; } $field .= ' ' . $parameters; } Quote Link to comment Share on other sites More sharing options...
♥raiwa Posted October 14, 2018 Author Share Posted October 14, 2018 Thank you , but this should be posted in the general bugs report: https://www.oscommerce.com/forums/topic/412984-edgefinalfrozen-bug-list/?tab=comments#comment-1771089 Quote About Me: http://www.oscommerce.com/forums/user/249059-raiwa/ Need help? How To Get The Help You Need Is your version of osC up to date? You'll find the latest osC community version CE Phoenix here. Public Phoenix Change Log Cheat Set on Google Sheets Link to comment Share on other sites More sharing options...
vmn Posted October 14, 2018 Share Posted October 14, 2018 Thanks. It's now posted there as well. Quote Link to comment Share on other sites More sharing options...
vmn Posted October 14, 2018 Share Posted October 14, 2018 Hi, If a country does not have zones, we do not need the state input entry. This is what I did: in includes/modules/checkout_new_address.php includes/modules/checkout_new_address.php account_pwa.php (I haven't tested this yet) replace the block: <?php if (ACCOUNT_STATE == 'true') { ?> ... <?php } ?> with the following lines: <?php if (ACCOUNT_STATE == 'true') { ?> <div id="results" class="form-group has-feedback"> <?php $zone_id = 0; $check_query = tep_db_query("select count(*) as total from " . TABLE_ZONES . " where zone_country_id = '" . $country . "'"); $check = tep_db_fetch_array($check_query); $entry_state_has_zones = ($check['total'] > 0); if ($entry_state_has_zones == true) { $zones_array = array(); $zones_array[0] = array('id' => '', 'text' => PULL_DOWN_DEFAULT); $zones_query = tep_db_query("select zone_name from " . TABLE_ZONES . " where zone_country_id = '" . $country . "' order by zone_name"); while ($zones_values = tep_db_fetch_array($zones_query)) { $zones_array[] = array('id' => $zones_values['zone_name'], 'text' => $zones_values['zone_name']); } echo '<label for="inputState" class="control-label col-sm-3">' . ENTRY_STATE .'</label>'; echo '<div class="col-sm-9">'; echo tep_draw_pull_down_menu('state', $zones_array, (isset($entry['entry_country_id']) ? tep_get_zone_name($entry['entry_country_id'], $entry['entry_zone_id'], $entry['entry_state']) : ''), 'required aria-required="true" id="inputState"'); echo FORM_REQUIRED_INPUT; echo '</div>'; if (tep_not_null(ENTRY_STATE_TEXT)) echo '<span class="help-block">' . ENTRY_STATE_TEXT . '</span>'; } ?> </div> <?php } ?> in get_states.php find: if ($entry_state_has_zones == true) { $zones_array = array(); $zones_array[0] = array('id' => '', 'text' => PULL_DOWN_DEFAULT); $zones_query = tep_db_query("select zone_name from zones where zone_country_id = '" . (int)$state . "' order by zone_name"); while ($zones_values = tep_db_fetch_array($zones_query)) { $zones_array[] = array('id' => $zones_values['zone_name'], 'text' => $zones_values['zone_name']); } echo tep_draw_pull_down_menu('state', $zones_array, '', 'required aria-required="true" id="inputState"'); echo FORM_REQUIRED_INPUT; } else { echo tep_draw_input_field('state', NULL, 'id="inputState" class="form-control" required aria-required="true" placeholder="' . ENTRY_STATE . '"'); echo FORM_REQUIRED_INPUT; } replace with: if ($entry_state_has_zones == true) { $zones_array = array(); $zones_array[0] = array('id' => '', 'text' => PULL_DOWN_DEFAULT); $zones_query = tep_db_query("select zone_name from zones where zone_country_id = '" . (int)$state . "' order by zone_name"); while ($zones_values = tep_db_fetch_array($zones_query)) { $zones_array[] = array('id' => $zones_values['zone_name'], 'text' => $zones_values['zone_name']); } echo '<label for="inputState" class="control-label col-sm-3">' . ENTRY_STATE .'</label>'; echo '<div class="col-sm-9">'; echo tep_draw_pull_down_menu('state', $zones_array, '', 'required aria-required="true" id="inputState"'); echo FORM_REQUIRED_INPUT; echo '</div>'; } Quote Link to comment Share on other sites More sharing options...
♥raiwa Posted October 14, 2018 Author Share Posted October 14, 2018 If a country does not have zones in the oscommerce zones table, it doesn't mean that zones are not used. That's why the input field is still available for manual customer input like in the standard forms. If your modification is good for your store ok, but it is not a generic modification which should be added to the add-on package (in my opinion). Quote About Me: http://www.oscommerce.com/forums/user/249059-raiwa/ Need help? How To Get The Help You Need Is your version of osC up to date? You'll find the latest osC community version CE Phoenix here. Public Phoenix Change Log Cheat Set on Google Sheets Link to comment Share on other sites More sharing options...
vmn Posted October 15, 2018 Share Posted October 15, 2018 Most of our customers are from Finland, i.e. no zones. I just do not love unnecessary input fields. Quote Link to comment Share on other sites More sharing options...
JimSmithWr Posted October 30, 2018 Share Posted October 30, 2018 Thank . I did it all. all thanks to you ! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.