Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

English Address


umtwebby

Recommended Posts

Posted

I want to make my cart more english! However when I upload the code below the Post Code Field does not show on the log in page. This means that when an account is created (or attempted) an error message asking for at least 4 post code digits even though there is no post code entry field. Can someone see where I am going wrong as I have poured over the code for many, many hours? The code is from an "English Address" contribution.

 

1) open catalog > create_account.php in your editor

 

//Start of english address

<table border="0" cellspacing="2" cellpadding="2">

<tr>

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

<td class="main"><?php echo tep_draw_input_field('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') . ' ' . (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') . ' ' . (tep_not_null(ENTRY_CITY_TEXT) ? '<span class="inputRequirement">' . ENTRY_CITY_TEXT . '</span>': ''); ?></td>

</tr>

<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');

}

 

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

?>

</td>

</tr>

<?php

if (ACCOUNT_STATE == 'true') {

?>

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

<?php

}

?>

<tr>

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

<td class="main"><?php echo tep_get_country_list('country') . ' ' . (tep_not_null(ENTRY_COUNTRY_TEXT) ? '<span class="inputRequirement">' . ENTRY_COUNTRY_TEXT . '</span>': ''); ?></td>

</tr>

</table>

//end of english address

 

2) open catalog > includes > languages > english.php with your editor

 

find this code

 

define('ENTRY_STREET_ADDRESS', 'Street Address:');

 

and replace it with

 

define('ENTRY_STREET_ADDRESS', 'Street Address:');

 

now find

 

define('ENTRY_SUBURB', 'Suburb:');

 

and replace it with

 

define('ENTRY_SUBURB', 'Address Line 2:');

 

now find

 

define('ENTRY_CITY', 'City:');

 

and replace it with

 

define('ENTRY_CITY', 'Town/City:');

 

now find

 

define('ENTRY_STATE', 'State/Province:');

 

and replace it with

 

define('ENTRY_STATE', 'County:');

Posted

 

 

 

Thanks for the prompt reply but the quoted contribution relates to a fresh install rather than a cart which has been modified. If I use the contribution as stated I have to change all the parameters of the cart again.

 

All I want is to know why the post code box won't show in the create account page from the code of the other contribution.

Posted
Thanks for the prompt reply but the quoted contribution relates to a fresh install rather than a cart which has been modified. If I use the contribution as stated I have to change all the parameters of the cart again.

 

All I want is to know why the post code box won't show in the create account page from the code of the other contribution.

 

Sorry, I didn't read the subject matter as well as I should as I was busy.

 

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

 

That contribution does indeed include the relevant postcode entry so if you applied it correctly it should be showing.

 

If it isn't showing then you have done it wrong. You need to reapply the default file and start again if you can't find the problem.

  • 2 weeks later...
Posted
Sorry, I didn't read the subject matter as well as I should as I was busy.

 

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

 

That contribution does indeed include the relevant postcode entry so if you applied it correctly it should be showing.

 

If it isn't showing then you have done it wrong. You need to reapply the default file and start again if you can't find the problem.

I have a problem, I have installed the contribution but in my db - the state and suburb entries are always empty. I also need to have english address from Admin. Please can anyone help I've been trying for months.

Posted
I have a problem, I have installed the contribution but in my db - the state and suburb entries are always empty. I also need to have english address from Admin. Please can anyone help I've been trying for months.

Download the address format change addon. In it find the sql for your country, run that sql in your db, and the admin will be done.

Posted
Download the address format change addon. In it find the sql for your country, run that sql in your db, and the admin will be done.

Sorry, where do I download the address format change addon, I can't see an additional download.

 

Do you mean these bits of the SQL file?

 

drop table if exists address_book;

create table address_book (

address_book_id int(11) not null auto_increment,

customers_id int(11) default '0' not null ,

entry_gender char(1) not null ,

entry_company varchar(32) ,

entry_firstname varchar(32) not null ,

entry_lastname varchar(32) not null ,

entry_street_address varchar(64) not null ,

entry_suburb varchar(32) ,

entry_postcode varchar(10) not null ,

entry_city varchar(32) not null ,

entry_state varchar(32) ,

entry_country_id int(11) default '0' not null ,

entry_zone_id int(11) default '0' not null ,

PRIMARY KEY (address_book_id),

KEY idx_address_book_customers_id (customers_id)

);

 

insert into address_book (address_book_id, customers_id, entry_gender, entry_company, entry_firstname, entry_lastname, entry_street_address, entry_suburb, entry_postcode, entry_city, entry_state, entry_country_id, entry_zone_id) values ('1', '1', 'm', 'ACME Inc.', 'John', 'Doe', '1 Way Street', '', '12345', 'NeverNever', '', '223', '12');

drop table if exists address_format;

create table address_format (

address_format_id int(11) not null auto_increment,

address_format varchar(128) not null ,

address_summary varchar(48) not null ,

PRIMARY KEY (address_format_id)

);

 

insert into address_format (address_format_id, address_format, address_summary) values ('1', '$firstname $lastname$cr$streets$cr$city, $postcode$cr$statecomma$country', '$city / $country');

insert into address_format (address_format_id, address_format, address_summary) values ('2', '$firstname $lastname$cr$streets$cr$city, $state $postcode$cr$country', '$city, $state / $country');

insert into address_format (address_format_id, address_format, address_summary) values ('3', '$firstname $lastname$cr$streets$cr$city$cr$postcode - $statecomma$country', '$state / $country');

insert into address_format (address_format_id, address_format, address_summary) values ('4', '$firstname $lastname$cr$streets$cr$city ($postcode)$cr$country', '$postcode / $country');

insert into address_format (address_format_id, address_format, address_summary) values ('5', '$firstname $lastname$cr$streets$cr$postcode $city$cr$country', '$city / $country');

 

In the UK Based OSCommerce contribution?

 

Thanks very much

Posted
Address Fornat Change Addon

 

Check it out on a test site.

 

I'm afraid I'm still struggling: The address format I want is:

 

First Name/ Last Name

Address Line 1

Address Line 2

County

Postcode

Country

 

I've got it all to work except the County, I just cannot get the value to store.

 

Thanks

Archived

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

×
×
  • Create New...