Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

change the state text field to a drop down??


Recommended Posts

echo tep_draw_pull_down_menu('state', $zones_array);

} else {

echo tep_draw_input_field('state');



from what i saw in the creat account php there is an option to create states a dropdown menu


from where you can initialize this?

Link to comment
Share on other sites

ok problem fixed



i did some programming


basically ill paste the code here


my country id was 55 but dont why it didnt pick it up

so i commented out the part that forced it to draw a text field made it alwats to draw a drop down and set a variable to my country id and and at the sql query insted of dynamic the country id i set it equal to my variable :D:D:D



there are 2 files that should be edited


checkout_new_address in modules

and create_account.php in the catalog


               <td class="main"><?php echo ENTRY_STATE; ?></td>
               <td class="main">
//   if ($process == true) {
   //  if ($entry_state_has_zones == true) {
$papas = 55;
$zones_array = array();
       $zones_query = tep_db_query("select zone_name from " . TABLE_ZONES . " where zone_country_id = '" .$papas."' 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;


also aboe the first <tr> was a <?php { ?> i deleted that and below was a <?php } ?> deleted that also




wow my first php manipulation feels nice :D

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...