Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

USA shipping only - remove all country options


jhande

Recommended Posts

First I apologize for I'm sure this has been discussed before, but I can't seem to find it. :blush:

 

I've searched the contributions but only seem to find things that depend on rates or other things.

 

What I want to accomplish:

 

  • Remove the country option from the create account page, address book, etc...
  • Also remove the country from the emails - order proccess/confirmation, update...
  • Have a drop down to select a State.

I don't have zones or anything setup as there's no tax involved and I only ship USPS.

 

Can anyone point me in the right direction please?

- :: Jim :: -

- My Toolbox ~ Adobe Web Bundle, XAMPP & WinMerge | Install ~ osC v2.3.3.4 -

Link to comment
Share on other sites

You could remove all the countries, except us, from the counties table.

 

This might get the brain cells working

 

In catalog/create_account.php

change:

 

 

CODE

tep_get_country_list('country')

 

to

 

CODE

tep_get_country_list('country', '150')

change 150 (Netherlands) to 222 for UK or to 223 for US etc etc

 

You can do the same for (if people want to change address at checkout):

catalog/includes/modules/checkout_new_address.php

Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Link to comment
Share on other sites

Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Link to comment
Share on other sites

Thanks Geoffrey ;)

 

Doesn't that just hide the country selection but still allow the country to be posted in such things as emails?

 

Example:

 

In the Order Process email -

 

Delivery Address

James Hande

1290 RT 25A

Orford, NH 03777

United States of America

 

I am trying to get all traces of the country removed if possible. :unsure:

- :: Jim :: -

- My Toolbox ~ Adobe Web Bundle, XAMPP & WinMerge | Install ~ osC v2.3.3.4 -

Link to comment
Share on other sites

Use address format.

That will help in some cases.

 

Satish

Ask/Skype for Free osCommerce value addon/SEO suggestion tips for your site.

 

Check My About US For who am I and what My company does.

Link to comment
Share on other sites

  • Have a drop down to select a State.

Important: Backup before attempting this. Based on country-state selector addon.

 

Look for this block of code in create_account.php

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

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

}

 

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

?>

 

 

Replace with this

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

<?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_array = array(array('id' => '', 'text' => PULL_DOWN_DEFAULT));

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

$zones_array = array();

$zones_array = array(array('id' => '', 'text' => PULL_DOWN_DEFAULT));

$zones_query = tep_db_query("select zone_name from " . TABLE_ZONES . " 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 {

$zones_array = array();

$zones_array = array(array('id' => '', 'text' => PULL_DOWN_DEFAULT));

$zones_query = tep_db_query("select zone_name from " . TABLE_ZONES . " 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);

}

 

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

?>

Link to comment
Share on other sites

Thanks everyone for the feedback and help. :)

 

 

Chris - I'm already down to the one country, USA.

 

Satish - I don't understand... "Use format address"... ?

 

Bryce - Isn't that dependent upon having zones setup?

 

 

:blush:

- :: Jim :: -

- My Toolbox ~ Adobe Web Bundle, XAMPP & WinMerge | Install ~ osC v2.3.3.4 -

Link to comment
Share on other sites

'customers_address_format_id' => $order->customer['format_id'],

 

INSERT INTO address_book VALUES ( '1', '1', 'm', 'ACME Inc.', 'John', 'Doe', '1 Way Street', '', '12345', 'NeverNever', '', '223', '12');

 

# 1 - Default, 2 - USA, 3 - Spain, 4 - Singapore, 5 - Germany

INSERT INTO address_format VALUES (1, '$firstname $lastname$cr$streets$cr$city, $postcode$cr$statecomma$country','$city / $country');

INSERT INTO address_format VALUES (2, '$firstname $lastname$cr$streets$cr$city, $state $postcode$cr$country','$city, $state / $country');

INSERT INTO address_format VALUES (3, '$firstname $lastname$cr$streets$cr$city$cr$postcode - $statecomma$country','$state / $country');

INSERT INTO address_format VALUES (4, '$firstname $lastname$cr$streets$cr$city ($postcode)$cr$country', '$postcode / $country');

INSERT INTO address_format VALUES (5, '$firstname $lastname$cr$streets$cr$postcode $city$cr$country','$city / $country');

 

 

These are few formats.

 

Modify and chek.Remove $country.

 

Should work out.

Ask/Skype for Free osCommerce value addon/SEO suggestion tips for your site.

 

Check My About US For who am I and what My company does.

Link to comment
Share on other sites

Thank you both - Satish and Bryce :)

 

I will get busy editing... ;)

- :: Jim :: -

- My Toolbox ~ Adobe Web Bundle, XAMPP & WinMerge | Install ~ osC v2.3.3.4 -

Link to comment
Share on other sites

I hid the country drop down menu, it defaults to the USA (country code 223)

 

I need just a little more help again regarding the State pull down menu for the create account page. :blush:

 

It seems to pull all kinds of names from the table, not just the States.

Other than deleting everything I don't need from the database zones table, can't I have the menu call just the zones associated with country_ID 223? I've tried adding 223 to a few places, it either doesn't make a difference or it returns error messages.

 

Here's the code I'm working with -

 

<?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 = '223'" . (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 {

$zones_array = array();

$zones_array = array(array('id' => '', 'text' => PULL_DOWN_DEFAULT));

$zones_query = tep_db_query("select zone_name from " . TABLE_ZONES . " 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);

}

 

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

?>

 

As you can see by the bold red text I tried it there which doesn't make a difference but at least no error messages.

If someone can point me in the correct direction as to how I can edit the PHP and not delete tons of entries in the zones table I would be truely grateful.

- :: Jim :: -

- My Toolbox ~ Adobe Web Bundle, XAMPP & WinMerge | Install ~ osC v2.3.3.4 -

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...