Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How to change address fields


Jonj1611

Recommended Posts

Posted

Hi, I live in the UK and would like the address field in the customer section to more represent UK addresses, does anyone know where I change the fields because I cannot see where to do it. Thanks.

Posted

hi i'm actaually looking for te same thing. anybody any ideas? need to move the post code field to right above the country field.

Did you try? Did you fail? No matter! Try again. Fail again! But fail better!

Posted

Hi, I know this probably isn't a really important subject but I have searched and I get a load of irrelevant results, can please some help. Thanks.

Posted
Hi, I know this probably isn't a really important subject but I have searched and I get a load of irrelevant results, can please some help. Thanks.

Sorry, that should say can please someone help. Doh!!

Posted

*BUMP* Sorry I really need this to complete my site, I am sure it can't be that difficult a question? The search feature is next to useless, over 30 pages or irrelevant information.

Posted

Hi Jonj,

I am a newcomer to osC and I am learning my way around an would like to pass on a tip that will help you.

 

I open my osC in my web editor and when i find something that i want to change i do a search.

 

For your problem i did a search for "State/Province:" which shows in the "Create Account" page.

Only one page showed up.. catalog/includeds/languages/english.php and the "State/Province:" shows on line 194 define('ENTRY_STATE', 'State/Province:');

 

All the fields in the Create Account page are shown here.

Posted

To test the above, i just changed "Suburb:" to "Address 2" and it worked.

Posted

Don't suppose you know how to change the order in which it is displayed or is that just a case of moving the defines around? Thanks

Posted

I would think so..

 

I am trying to figure out how to add new fields to the customer data..

I want them to be able to specify trip dates, passport numbers, and a couple of other fields.

Posted
hmm, could change the text but even though I changed the define positions, post code is still in the 'wrong' place.

Do a search in contributions for create_account.php state and zip flip

Perhaps this is what you need.

Posted

Unfortunately that file seemed to relate to an older version of oscommerce, does anybody know of a way to change the order of the address fields and how the date of birth is displayed, ie I want it like this 24/01/2000. Thanks

Posted

to change the address fields to appear into BRITISH format you need to do two small modifications as follows:

 

two files need changing:

 

catalog/create_account.php

catalog/includes/modules/address_book_details.php

 

in both files you need to find this bit of code:

 

<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>

 

and simple move it to the appropriate place. for instance i just place it between state and country fields and it'd look like this:

 

<tr>
? ? ? ? ? ?<td class="main"><?php echo ENTRY_STREET_ADDRESS; ?></td>
? ? ? ? ? ?<td class="main"><?php echo tep_draw_input_field('street_address', $entry['entry_street_address']) . ' ' . (tep_not_null(ENTRY_STREET_ADDRESS_TEXT) ? '<span class="inputRequirement">' . ENTRY_STREET_ADDRESS_TEXT . '</span>': ''); ?></td>
? ? ? ? ?</tr>
<?php
?if (ACCOUNT_SUBURB == 'true') {
?>
? ? ? ? ?<tr>
? ? ? ? ? ?<td class="main"><?php echo ENTRY_SUBURB; ?></td>
? ? ? ? ? ?<td class="main"><?php echo tep_draw_input_field('suburb', $entry['entry_suburb']) . ' ' . (tep_not_null(ENTRY_SUBURB_TEXT) ? '<span class="inputRequirement">' . ENTRY_SUBURB_TEXT . '</span>': ''); ?></td>
? ? ? ? ?</tr>
<?php
?}
?>
? ? ? ? ?<tr>
? ? ? ? ? ?<td class="main"><?php echo ENTRY_CITY; ?></td>
? ? ? ? ? ?<td class="main"><?php echo tep_draw_input_field('city', $entry['entry_city']) . ' ' . (tep_not_null(ENTRY_CITY_TEXT) ? '<span class="inputRequirement">' . ENTRY_CITY_TEXT . '</span>': ''); ?></td>
? ? ? ? ?</tr>
<?php
?if (ACCOUNT_STATE == 'true') {
?>
? ? ? ? ?<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>
<?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>
? ? ? ? ?<tr>
? ? ? ? ? ?<td class="main"><?php echo ENTRY_COUNTRY; ?></td>
? ? ? ? ? ?<td class="main"><?php echo tep_get_country_list('country', $entry['entry_country_id']) . ' ' . (tep_not_null(ENTRY_COUNTRY_TEXT) ? '<span class="inputRequirement">' . ENTRY_COUNTRY_TEXT . '</span>': ''); ?></td>
? ? ? ? ?</tr>

 

To change STATE to COUNTY simply modify catalog/includes/languages/english.php

 

in admin disable SUBURB. and you are done with the address bit.

 

to change the date to BRITISH format follow my instructions in this link:

 

http://www.oscommerce.com/forums/index.php?showtopic=103656&hl=

 

good luck

Did you try? Did you fail? No matter! Try again. Fail again! But fail better!

Posted

Hi Siavash, your a star, now at least my site address are starting to look OK, many thanks and many thanks for restoring my faith in the community. :D

Posted

if you want your country field (country drop down) in the address show United Kingdom

 

in catalog/includes/functions/html_output.php, about the end of it, look for:

 

PULL_DOWN_DEFAULT

and replace it by the following

'United Kingdom'

 

result: instead of Please Select you will have United Kingdom as default country!

Did you try? Did you fail? No matter! Try again. Fail again! But fail better!

Posted

NOT DONE!

 

we are not done yet, i just realized!!!

 

if you have changed the address fields to British you need to also modify the postcode bit of code in at least two other files similar to what we did before. they are:

 

catalog/checkout_shipping_address.php and catalog/checkout_payment_address.php

catalog/includes/modules/checkout_new_address.php

 

also in all of the modified files including the previous ones i have aslo moved all instances of postcode to the right place i.e. after the state for example compare this code with the original code in the checkout_shipping_address.php (nearly in the end):

 

$addresses_query = tep_db_query("select address_book_id, entry_firstname as firstname, entry_lastname as lastname, entry_company as company, entry_street_address as street_address, entry_suburb as suburb, entry_city as city, entry_state as state, entry_zone_id as zone_id, entry_postcode as postcode, entry_country_id as country_id from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "'");

 

ALSO THERE's A PROBLEM WITH PRE-SELECTED "UNITED KINGDOM" IN COUNTRY DROPDOWN IN ADDRESS! i realized that even tho' united kingdom is preselected there's a pop up that says please enter the country!! and you have to choose united kingdon from the list again! not good, eh? i'm working on this one. if you found out quicker let me know please.

Did you try? Did you fail? No matter! Try again. Fail again! But fail better!

Archived

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

×
×
  • Create New...