cLin Posted September 20, 2009 Posted September 20, 2009 When creating an account, the state field doesn't show a dropdown box anymore when I select United States or Canada as my country. It's always showing an input box. When I remove the first two if statements and the closing brackets, it'll show a dropdown box but with no values inside it. It's like it cannot bring up the list of zones. Yet when I go into mysql and run the statement "select zone_name from zones where zone_country_id = 223 order by zone_name" it'll return the list of states for US. I did modify the files a bit, I'm more of looking for suggestions on how I would go about troubleshooting this. I mean, I looked at where the function tep_draw_pull_down_menu was located and it didn't seem like anything was wrong with the code from the original install so I have no idea what's going on. Is there an option I need to toggle in the admin panel? Using the default create_account.php file also doesn't fix it, still shows the input field instead of dropdown box. The two mods that edited this file that I used are seperate pricing per customer 4.22 and purchase without account 2.1. Any guidance would be nice. <?php if ($process == true) { if ($entry_state_has_zones == true) { $zones_array = array(); $zones_query = tep_db_query("select zone_name from " . TABLE_ZONES . " where zone_country_id = '" . (int)$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 tep_draw_pull_down_menu('state', $zones_array); } else { echo tep_draw_input_field('state'); } } else { echo tep_draw_input_field('state'); } if (tep_not_null(ENTRY_STATE_TEXT)) echo ' <span class="inputRequirement">' . ENTRY_STATE_TEXT; print $process; print $entry_state_has_zones; ?> This code is where the statement that determines whether the field should be a text box or dropdown.
♥ecartz Posted September 20, 2009 Posted September 20, 2009 When creating an account, the state field doesn't show a dropdown box anymore when I select United States or Canada as my country. It's always showing an input box.You may need to reinstall the contribution that you were using to change to the drop down when United States or Canada is selected, as what you are describing is the standard behavior. It only shows the drop down if the form is submitted but an error blocks the form from being processed. If the form is not processed, then the country won't be set yet, so it won't know what zones to display. You need to add javascript to change the box to a drop down when the country is selected. There are at least two contributions that do this, the Country State Selector and the DHTML State Input (which is listed under my addons). Always back up before making changes.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.