Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Fix & Change create_account.php


dnl07

Recommended Posts

Posted

I have a 3 part question:

 

1) When customers create a new account they are asked to enter the state, the customers are entering the 2 letter ab. For example - for Michigan they enter "MI" and continue... But the problem is when they click continue at the bottom of the page, it says "You must enter a state to continue. please select one from the drop down... Is there a way to allow customers to either:

A) First select from the drop down Or,

B) Enter the abreveation for the state (MI for Michigan)

 

2) How do i make the US the first or the Only option for selecting a country?

 

3) How can I move the Post Code Down under the State?

Posted

#2) Delete all the other countries. It is easier to write down what the US is and delete them all, then add the US back in.

 

 

#1 and #3) Find this section and in create_account.php and change it to the following (the ?????? should be the country code for the US, which I can't remember what it is. Either 223 or 38)

 

<?php

if (ACCOUNT_STATE == 'true') {

?>

<tr>

<td class="main" width="150"><font color="#FFFFFF"><?php echo ENTRY_STATE; ?></font></td>

<td class="main">

<?php

$zones_array[] = array('id' => '', 'text' => 'Please Select');

$zones_query = tep_db_query("select zone_name from " . TABLE_ZONES . " where zone_country_id = '223' 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']);

}

 

$zones_array2[] = array('id' => '', 'text' => '----------');

$zones_query2 = tep_db_query("select zone_name from " . TABLE_ZONES . " where zone_country_id = '38' order by zone_name");

while ($zones_values = tep_db_fetch_array($zones_query2)) {

$zones_array2[] = array('id' => $zones_values['zone_name'], 'text' => $zones_values['zone_name']);

}

echo tep_draw_pull_down_menu('state', array_merge($zones_array, $zones_array2), 'Please Select');

 

if (tep_not_null(ENTRY_STATE_TEXT)) echo ' <span class="inputRequirement">' . ENTRY_STATE_TEXT;

?>

</td>

</tr>

<?php

}

?>

<tr>

<td class="main" width="150"><font color="#FFFFFF"><?php echo ENTRY_POST_CODE; ?></font></td>

<td class="main" width="150"><?php echo tep_draw_input_field('postcode') . ' ' . (tep_not_null(ENTRY_POST_CODE_TEXT) ? '<span class="inputRequirement">' . ENTRY_POST_CODE_TEXT . '</span>': ''); ?></td>

<td class="main" width="150"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<tr>

<td class="main" width="150"><font color="#FFFFFF"><?php echo ENTRY_COUNTRY; ?></font></td>

<td class="main" width="150"><?php echo tep_get_country_list('country') . ' ' . (tep_not_null(ENTRY_COUNTRY_TEXT) ? '<span class="inputRequirement">' . ENTRY_COUNTRY_TEXT . '</span>': ''); ?></td>

<td class="main" width="150"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

 

 

 

 

 

 

 

*****************************************************************

This part is what puts the Postal Code on the page where it is, you can move it to where you need. The word "Postal Code" is stored in the coresponding english language file.

<tr>

<td class="main" width="150"><font color="#FFFFFF"><?php echo ENTRY_POST_CODE; ?></font></td>

<td class="main" width="150"><?php echo tep_draw_input_field('postcode') . ' ' . (tep_not_null(ENTRY_POST_CODE_TEXT) ? '<span class="inputRequirement">' . ENTRY_POST_CODE_TEXT . '</span>': ''); ?></td>

<td class="main" width="150"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

 

 

 

 

 

I hope that makes some sense. :thumbsup:

Archived

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

×
×
  • Create New...