Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Zipcode problems...


jwsfun

Recommended Posts

Two problems that are driving me batty:

 

If I click on "My Account" in the header bar and navigate to the account.php page, the zipcode is NOT being displayed.

If I click on the "Edit Account" button and go to the next page (account_edit.php), I can fill in the zipcode, click on "Continue" button and go to the NEXT page (account_edit_process.php) and then I run into the SECOND problem...

I click on the "Continue" button again but I am NOT able to go to the next page (whicch of course, I don't know what it is).

 

NONE of this occurred until I edited the checkout_new_address.php AND the address_book_details.php files.

 

I need to keep "post code" as "zip code", and I do not know what is causing this problem. Does anyone have any ideas what I'm missing?

 

I even went as far as to edit the following (changing "post" to "zip"):

 

account.php: line 63

account_edit.php: line 63

account_edit_process.php: lines 37, 98, 100, 102 and 269

address_book_process.php: lines 43, 88, 89, 92, 146, 183, 215, 246 and 247

checkout_payment_process.php: lines 39, 84, 85, 88, 146, 262, 297, 298 and 444

create_account_process.php: lines 34, 95, 97, 99 and 271

 

Of course, "1054" errors popped-up at every turn and I switched all of the above back to "post". However, the two problems listed above STILL remain and I am at a standstill with this...Does anyone know what I'm missing here? I'm stumped <_<

Link to comment
Share on other sites

I need to keep "post code" as "zip code", and I do not know what is causing this problem. Does anyone have any ideas what I'm missing?

Try restoring from backup so that you have the original files. Then in includes/languages/english.php (and whatever other languages you'd like) around lines 188-190, change the following

define('ENTRY_POST_CODE', 'Post Code:');
define('ENTRY_POST_CODE_ERROR', 'Your Post Code must contain a minimum of ' . ENTRY_POSTCODE_MIN_LENGTH . ' characters.');
define('ENTRY_POST_CODE_TEXT', '*');

to

define('ENTRY_POST_CODE', 'Zip Code:');
define('ENTRY_POST_CODE_ERROR', 'Your Zip Code must contain a minimum of ' . ENTRY_POSTCODE_MIN_LENGTH . ' characters.');
define('ENTRY_POST_CODE_TEXT', '*');

and see if that changes it everywhere for you. In general, it is a bad idea to modify things IN_ALL_CAPS. Instead, just modify their appearance in the language files or database.

 

Hth,

Matt

Link to comment
Share on other sites

I've already changed these lines to read as:

 

define('ENTRY_ZIP_CODE', 'Zip Code:');

define('ENTRY_ZIP_CODE_ERROR', 'Your Zip Code must contain a minimum of ' . ENTRY_ZIPCODE_MIN_LENGTH . ' characters.');

define('ENTRY_ZIP_CODE_TEXT', '*');

 

Changing ANY of these back to the way they were results in occurences of the definitions showing up on the webpage ("ZIP_CODE_TEXT" for example will appear next to the ZipCode entry on the account_edit.php page, if it is changed to read "POST_CODE_TEXT").

Link to comment
Share on other sites

Just so ya know: If I attempt to check-out there is no problem with the zipcode being displayed in the shipping address. It is ONLY when any attempt to edit a customer's information (i.e., zipcode in this case) is this problem encountered. Why the zipcode isn't initially displayed on the account.php page is beyond me (and still, I can't navigate PAST the account_edit_process.php page and it is driving me crazy:().

Link to comment
Share on other sites

<_< After several hours of searching for the problem I somehow created, I found it and wanted to kick myself...

 

First, I changed (in shop/includes/languages/english.php):

 

define('ENTRY_ZIP_CODE', 'Zip Code:');

define('ENTRY_ZIP_CODE_ERROR', 'Your Zip Code must contain a minimum of ' . ENTRY_ZIPCODE_MIN_LENGTH . ' characters.');

define('ENTRY_ZIP_CODE_TEXT', '*');

 

Back to...

 

define('ENTRY_POST_CODE', 'Zip Code:');

define('ENTRY_POST_CODE_ERROR', 'Your Zip Code must contain a minimum of ' . ENTRY_POSTCODE_MIN_LENGTH . ' characters.');

define('ENTRY_POST_CODE_TEXT', '*');

 

Next, I moved (in shop/includes/modules/address_book_details.php, AND checkout_new_address.php):

 

<tr>

<td class="main"><?php echo ENTRY_POST_CODE; ?></td>

<td class="main"><?php echo tep_draw_input_field('postcode', $entry['entry_postcode']) . ' ' . (tep_not_null(ENTRY_POST_CODE_TEXT) ? '<span class="inputRequirement">' . ENTRY_POST_CODE_TEXT . '</span>': ''); ?></td>

</tr>

 

To below (again, in BOTH files)...

 

<tr>

<td class="main"><?php echo ENTRY_STATE; ?></td>

<td class="main">

<?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', tep_get_zone_name($entry['entry_country_id'], $entry['entry_zone_id'], $entry['entry_state']));

}

 

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

?></td>

</tr>

 

And FINALLY, I moved the postcode information below the state information in shop/includes/modules/account_details.php, to read like this:

 

<?php

if (ACCOUNT_STATE == 'true') {

?>

<tr>

<td class="main"> <?php echo ENTRY_STATE; ?></td>

<td class="main"> 

<?php

$state = tep_get_zone_name($country, $zone_id, $state);

if ($is_read_only) {

echo tep_get_zone_name($account['entry_country_id'], $account['entry_zone_id'], $account['entry_state']);

} elseif ($error) {

if ($entry_state_error) {

if ($entry_state_has_zones) {

$zones_array = array();

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

} else {

echo tep_draw_input_field('state') . ' ' . ENTRY_STATE_ERROR;

}

} else {

echo $state . tep_draw_hidden_field('zone_id') . tep_draw_hidden_field('state');

}

} else {

echo tep_draw_input_field('state', tep_get_zone_name($account['entry_country_id'], $account['entry_zone_id'], $account['entry_state'])) . ' ' . ENTRY_STATE_TEXT;

}

?></td>

</tr>

<tr>

<td class="main"> <?php echo ENTRY_POST_CODE; ?></td>

<td class="main"> 

<?php

if ($is_read_only) {

echo $account['entry_postcode'];

} elseif ($error) {

if ($entry_post_code_error) {

echo tep_draw_input_field('postcode') . ' ' . ENTRY_POST_CODE_ERROR;

} else {

echo $postcode . tep_draw_hidden_field('postcode');

}

} else {

echo tep_draw_input_field('postcode', $account['entry_postcode']) . ' ' . ENTRY_POST_CODE_TEXT;

}

?></td>

</tr>

<?php

}

?>

 

That's it...Now it's all working...Zip codes are where I want them and the problem with creating new accounts is gone as well. PHEW. :wacko:

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...