Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Configuration help with setup.


Guest

Recommended Posts

Posted

I'd want to allow customers to select the State from a drop down menu in the checkout process, and have the county (US) already set in own its own. currently out of the box, customers have to type in the state, then on the next screen select it on the dropdown menu. I'd like to have it done just once. How can that be done?

 

 

 

thanks

rudy

Posted

This is not a complete solution for you, but is better than nothing. In catalog>create_account.php, after:

 

$state = tep_db_prepare_input($HTTP_POST_VARS['state']);

 

Add This:

   switch ($state) {
       case 'AL':
         $state = 'Alabama';
         break;
       case 'AK':
         $state = 'Alaska';
         break;
       case 'AS':
         $state = 'American Samoa';
         break;
       case 'AZ':
         $state = 'Arizona';
         break;
       case 'AR':
         $state = 'Arkansas';
         break;
       case 'CA':
         $state = 'California';
         break;
 case 'CO':
         $state = 'Colorado';
         break;
 case 'CT':
   $state = 'Connecticut';
   break;
 case 'DE':
   $state = 'Delaware';
   break;
 case 'DC':
   $state = 'District of Columbia';
   break;
 case 'FM':
   $state = 'Federated States of Micronesia';
   break;
 case 'FL':
   $state = 'Florida';
   break;
 case 'GA':
   $state = 'Georgia';
   break;
 case 'GU':
   $state = 'Guam';
   break;
 case 'HI':
   $state = 'Hawaii';
   break;
 case 'ID':
   $state = 'Idaho';
   break;
 case 'IL':
   $state = 'Illinois';
   break;
 case 'IN':
   $state = 'Indiana';
   break;
 case 'IA':
   $state = 'Iowa';
   break;
 case 'KS':
   $state = 'Kansas';
   break;
 case 'KY':
   $state = 'Kentucky';
   break;
 case 'LA':
   $state = 'Louisiana';
   break;
 case 'ME':
   $state = 'Maine';
   break;
 case 'MH':
   $state = 'Marshall Islands';
   break;
 case 'MD':
   $state = 'Maryland';
   break;
 case 'MA':
   $state = 'Massachusetts';
   break;
 case 'MI':
   $state = 'Michigan';
   break;
 case 'MN':
   $state = 'Minnesota';
   break;
 case 'MS':
   $state = 'Mississippi';
   break;
 case 'MO':
   $state = 'Missouri';
   break;
 case 'MT':
   $state = 'Montana';
   break;
 case 'NE':
   $state = 'Nebraska';
   break;
 case 'NV':
   $state = 'Nevada';
   break;
 case 'NH':
   $state = 'New Hampshire';
   break;
 case 'NJ':
   $state = 'New Jersey';
   break;
 case 'NM':
   $state = 'New Mexico';
   break;
 case 'NY':
   $state = 'New York';
   break;
 case 'NC':
   $state = 'North Carolina';
   break;
 case 'ND':
   $state = 'North Dakota';
   break;
 case 'MP':
   $state = 'Northern Mariana Islands';
   break;
 case 'OH':
   $state = 'Ohio';
   break;
 case 'OK':
   $state = 'Oklahoma';
   break;
 case 'OR':
   $state = 'Oregon';
   break;
 case 'PW':
   $state = 'Palau';
   break;
 case 'PA':
   $state = 'Pennsylvania';
   break;
 case 'PR':
   $state = 'Puerto Rico';
   break;
 case 'RI':
   $state = 'Rhode Island';
   break;
 case 'SC':
   $state = 'South Carolina';
   break;
 case 'SD':
   $state = 'South Dakota';
   break;
 case 'TN':
   $state = 'Tennessee';
   break;
 case 'Texas':
   $state = 'Texas';
   break;
 case 'UT':
   $state = 'Utah';
   break;
 case 'VT':
   $state = 'Vermont';
   break;
 case 'VI':
   $state = 'Virgin Islands';
   break;
 case 'VA':
   $state = 'Virginia';
   break;
 case 'WA':
   $state = 'Washington';
   break;
 case 'WV':
   $state = 'West Virginia';
   break;
 case 'WI':
   $state = 'Wisconsin';
   break;
 case 'WY':
   $state = 'Wyoming';
   break;
     }

This way, if they type in an abbreviation instead of spelling out the name, it will still go through.

 

I'm not sure what the code is for just having the US in your Countries box (although I've seen posts about it before) this is how you get United States to be default:

 

In catalog>includes>functions>general>html_output.php, change:

$countries_array = array(array('id' => '', 'text' => PULL_DOWN_DEFAULT));

 

To:

$countries_array = array(array('id' => '223', 'text' => 'United States'));

 

Hope this helps!

Archived

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

×
×
  • Create New...