Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

postal code and state field order


knblair

Recommended Posts

Posted

Can anyone advise or provide code samples for placing the zip/postal field after the state field in the create account module?

 

Thanks much!

Posted

I'm assuming you are referring to create_account.php (since you didn't specify) but the change is pretty much the same no matter where you may change it. In create_account.php, find the following code:

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

 

That's the code that outputs the postal code. Right around there will be the code to output the state, city, etc.

 

Backup first, then rearrange the sections as you see fit.

 

-jared

  • 5 weeks later...
Posted
I'm assuming you are referring to create_account.php (since you didn't specify) but the change is pretty much the same no matter where you may change it.  In create_account.php, find the following code:
              <tr>
               <td class="main"><?php echo ENTRY_POST_CODE; ?></td>
               <td class="main"><?php echo tep_draw_input_field('postcode') . ' ' . (tep_not_null(ENTRY_POST_CODE_TEXT) ? '<span class="inputRequirement">' . ENTRY_POST_CODE_TEXT . '</span>': ''); ?></td>
             </tr>

 

That's the code that outputs the postal code.  Right around there will be the code to output the state, city, etc. 

 

Backup first, then rearrange the sections as you see fit.

 

-jared

 

 

Excellent! That worked!

 

So which file do I edit to make the SAME change in the UPDATE ADDRESS BOOK ENTRY page??

 

I thight it might have been /address_book_process.php but it's not.

Posted
So which file do I edit to make the SAME change in the UPDATE ADDRESS BOOK ENTRY page??

 

I thight it might have been /address_book_process.php but it's not.

 

I didn't know, but I'll tell you how I found it. There are 2 ways that osCommerce references external files. One way is to use the require command, as in:

  require('includes/application_top.php');

. The other way is to use the include command, as in

        <td><?php include(DIR_WS_MODULES . 'address_book_details.php'); ?></td>

 

In this case, you know that the code you want to change is rendered in address_book_process.php. You can see that the code is not directly displayed in that file, so let's look at all of the other files that are either included or required:

- includes/application_top.php

- includes/your language file

- includes/header.php

- includes/column_left.php

- includes/form_check.js.php

- includes/modules/address_book_details.php

- includes/column_right.php

- includes/footer.php

- includes/application_bottom.php

 

Guess which one you need to change? :)

 

-jared

Archived

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

×
×
  • Create New...