Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Customer address details - Please help


crazymonkey

Recommended Posts

I have been trying to change the address format in all parts of the site to work in the UK (rename fields and change order they appaer). So far I have managed to change the account creation page and field names successfully, but I cant work out how to change the order the fields are displayed in the Address Book Entries and invoices etc.

 

Please help, as I have been trying to do this for several days and I'm out of ideas.

 

Thanks in Advance

 

CM :)

Link to comment
Share on other sites

I would love to know the answer to this as well, but the problem I am having specifically is that my clients site is having trouble when a client tries to add their county into the state field.

 

This is the specific problem as told to me in an email:

 

**** She tried to order an item and it all went through fine, except when she created her account in the "Create Account" page, it would not let her input "Surrey" as her County/State (as this is where she lives). So she clicked "Continue" and she got a message to say to select the County/State from the drop-down list and she could only choose "West Drayton" - which is where Mark and I live!!!

 

This needs to be a free-format text box like the other address fields - can you make a minor tweak to remove whatever is defaulting to West Drayton to allow people to input plain text instead?! ****

 

Maybe you know how to fix this?

 

Karole

Thanks,

 

Karole

Link to comment
Share on other sites

  • 2 years later...
I still havent found how to make this work.

 

Please help.

 

I am having this problem too. It won't recognise London as a state and now loads of customers addresses read 'Alderney as that is the only one it will allow them!!!

Link to comment
Share on other sites

  • 6 months later...

According to Royal Mail, a postal address in the UK needs to consist of the following elements:

 

Building Name/Number of building;

name of street/road;

post town;

post code.

 

A county name is not required.

 

A simple way to achieve this is to make the following changes in the create_account.php under includes/languages/endglish:

Street Address to address line 1,

Suburb to address line 2,

City to City/Town.

The above fields are all free text.

 

The next step is to swap the spaces (the block of code) referring to city and post code in catalog/create_account.php, making city come before post code.

 

Finally, in admin, under configuration, select customer details, and set 'state' to false (do not use state in addresses).

 

HTH,

 

Ken

commercial support - unProtected channel, not to be confused with the forum with same name - open to everyone who need some professional help: either PM/email me, or go to my website (URL can be found in my profile).

over 20 years of computer programming experience.

Link to comment
Share on other sites

  • 7 months later...

Does moving the postal code block of code down only need to be done in catalog/create_account.php? What about for other shippung addresses entry or is this module called for any address book entry? Thanks for the note on catalog/create_account.php as I had looked in 3 other modules: address_book_process.php, checkout_shipping_address.php, and checkout_payment_address.php and wasn't finding any place to really change the display order.

 

Philip

Link to comment
Share on other sites

  • 2 weeks later...

As well as changing catalog/create_account.php you also have to go into your actual database and change the address_format table to get the address order how you want it.

 

Does moving the postal code block of code down only need to be done in catalog/create_account.php? What about for other shippung addresses entry or is this module called for any address book entry? Thanks for the note on catalog/create_account.php as I had looked in 3 other modules: address_book_process.php, checkout_shipping_address.php, and checkout_payment_address.php and wasn't finding any place to really change the display order.

 

Philip

Link to comment
Share on other sites

As well as changing catalog/create_account.php you also have to go into your actual database and change the address_format table to get the address order how you want it.

 

Does moving the postal code block of code down only need to be done in catalog/create_account.php? What about for other shippung addresses entry or is this module called for any address book entry? Thanks for the note on catalog/create_account.php as I had looked in 3 other modules: address_book_process.php, checkout_shipping_address.php, and checkout_payment_address.php and wasn't finding any place to really change the display order.

 

Philip

Link to comment
Share on other sites

  • 2 months later...
  • 1 month later...

Hi all,

I've been looking for a solution and the next I get was this topic.

 

I need only the zipcode (postcode) number variable as seem in address_book_process.php when logged in, and the total cart weight number variable as seem in order form.

 

I'm from Brazil and I have a script that uses sender zipcode, destiny zipcode and wheight of package to calculate the freight. But I get none of them except the sender zipcode

 

 

 

In address_book_process.php line 191 I get all variables that fills the filed of the page, but when I try to use them in other forms, I can't.

 

if (isset($HTTP_GET_VARS['edit']) && is_numeric($HTTP_GET_VARS['edit'])) {

$entry_query = tep_db_query("select entry_gender, entry_company, entry_firstname, entry_lastname, entry_street_address, entry_suburb, entry_postcode, entry_city, entry_state, entry_zone_id, entry_country_id from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "' and address_book_id = '" . (int)$HTTP_GET_VARS['edit'] . "'");

 

 

 

 

 

Some help?

Link to comment
Share on other sites

I want to use some like this:

 

 

if (isset($HTTP_GET_VARS['edit']) && is_numeric($HTTP_GET_VARS['edit'])) {

$entry_query = tep_db_query("postcode" . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "' and address_book_id = '" . (int)$HTTP_GET_VARS['edit'] . "'");

 

 

to generate the folowing result in testzipcode.php:

 

 

 

 

13630-000

 

 

 

 

I know that the table is "address_book", the variable is "postcode"; but I don't know how connect to data base (I need to be logged in to have access to testzipcode.php information)

Link to comment
Share on other sites

I got the address and the weight!!!!

 

Save a new php file and access it when logged:

 

 

<?php echo tep_address_label($customer_id, $sendto, true, ' ', '<br>'); ?><br>

<br />

<?php echo $total_weight = $cart->show_weight();?>

 

 

 

 

 

 

 

 

 

But the address is complete. I need only the zipcode...

Any ideia left?

Link to comment
Share on other sites

I tried this:

 

 

 

<?php

$db = mysql_connect("mysql.kinggost.net", "michelangelo51", "*******");

$sql = "SELECT * FROM address_book ORDER BY customers_id";

$resultado = mysql_query($sql)

or die ("Sorry. Try later");

echo "<table width=200 border=1 align=center>\n";

echo "<tr><td>postcode</td></tr>\n";

while ($linha = mysql_fetch_row($resultado)) {

printf("<tr><td>%s</td></tr>\n", $linha[8]);

}

echo "</table>\n";

?>

 

 

 

But I have ALL postcodes. I want only the logged in costumer's postcode.

Who knows the mysql OsCommerce routine to correct the former code or show me the variables printed on checkout_confirmation.php..... I need this variables to fill in another form in my website.

 

PLEASE LISTEN ME!!!!

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...