2009/08/19

Zip after State in Create Account

Filed under: osCommerce Coding — Tags: , , , — eCartz @ 22:56  Share/Bookmark  Delicious  StumbleUpon  WordPress  Twitter  LinkedIn

For those in the UK, Gary Burton’s osCommerce for the UK provides instructions for how to move the post code after county.  Since the position of the zip code is just as inappropriate in the US as in the UK, I’m posting the equivalent instructions here. 

First, make a backup copy of create_account.php.  Since you are going to be modifying it, you want to have a known good copy available in case something goes wrong. 

Look for the following code in create_account.php (line numbers are from a stock osCommerce install and may differ on your site): 

 PHP |   copy code |? 
403
              <tr>
404
                <td class="main"><?php echo ENTRY_POST_CODE; ?></td>
405
                <td class="main"><?php echo tep_draw_input_field('postcode') . '&nbsp;' . (tep_not_null(ENTRY_POST_CODE_TEXT) ? '<span class="inputRequirement">' . ENTRY_POST_CODE_TEXT . '</span>': ''); ?></td>
406
              </tr>

Copy this code and find: 

 PHP |   copy code |? 
440
              <tr>
441
                <td class="main"><?php echo ENTRY_COUNTRY; ?></td>
442
                <td class="main"><?php echo tep_get_country_list('country') . '&nbsp;' . (tep_not_null(ENTRY_COUNTRY_TEXT) ? '<span class="inputRequirement">' . ENTRY_COUNTRY_TEXT . '</span>': ''); ?></td>
443
              </tr>

Just before that and after

 PHP |   copy code |? 
433
    if (tep_not_null(ENTRY_STATE_TEXT)) echo '&nbsp;<span class="inputRequirement">' . ENTRY_STATE_TEXT;
434
?>
435
                </td>
436
              </tr>
437
<?php
438
  }
439
?>

paste the code that you copied. 

Now, the safe thing to do is to save the file (uploading to a test site if necessary) and view the page in the browser.  If the page appears perfectly except that it now has two zip code boxes, then you can go back and delete the code from lines 403 to 406.  If things are not okay, you can either try to figure out why or just restore your backup and start over. 

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

You can log in to post a comment, or just fill out your name and email.

Powered by WordPress