Zen Cart Logo
Forums / Built-in Shipping and Payment Modules / Ship to only two countries

Ship to only two countries

Views: 7,071

Results 1 to 20 of 24
30 Apr 2012, 2:03 AM
#1
onejimb avatar

onejimb

New Zenner

Join Date:
Apr 2009
Posts:
31
Plugin Contributions:
0

Ship to only two countries

How do I indicate that I only ship to USA and Canada. When a customers selects "Estimate Shipping" it list all the countries. I want to show the shipping rates to only to USA and Canada.

Thanks for your help.

30 Apr 2012, 2:28 AM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Ship to only two countries

Build a Zone Definition and define the Countries/States in the DETAILS of the Zone Definition and add it to your shipping modules ...

1 May 2012, 3:06 AM
#3
onejimb avatar

onejimb

New Zenner

Join Date:
Apr 2009
Posts:
31
Plugin Contributions:
0

Re: Ship to only two countries

I have done exactly what you said (I think) and still having problems.
The main issue is that when I go to the shopping chat and select a product and then see the "Estimate Shipping Cost" block appears. In the drop down "Country" field it show all the countries in the world. I need it to show only the Country I ship to, not all Countries that I do not ship to.

Thanks for your help.

1 May 2012, 2:01 PM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Ship to only two countries

There are two ways to do it ... add to the Shipping estimator the text that you only ship to 2 countries so they know why if they choose a different country they get no quote ...

Or, backup the database table:
countries

via phpMyAdmin, then delete all other countries ... this would allow you to later add back the other countries, should you need them in the future ...

1 May 2012, 6:50 PM
#5
onejimb avatar

onejimb

New Zenner

Join Date:
Apr 2009
Posts:
31
Plugin Contributions:
0

Re: Ship to only two countries

Thanks for your help. It seems odd that we would need to edit the data base or edit the php file to remove all of the Countries that are not shipped to. I suspect that this would be a very common issue with most zencart users.

I have now decided to ship to only one county, USA. so how about just rem out the line that says Country and the drop down menu Country menu. I can add a note that says the I only ship to USA. What is the name of the file that I would need to edit?

Again, Thanks for your help

1 May 2012, 6:53 PM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Ship to only two countries

onejimb:

Thanks for your help. It seems odd that we would need to edit the data base or edit the php file to remove all of the Countries that are not shipped to. I suspect that this would be a very common issue with most zencart users.
It is indeed unfortunate and inconvenient. That's why for ZC v2 we're adding the ability to simply use a checkbox to indicate which countries should be "active" vs not.
So, while that doesn't help you today, at least you know there'll be some reprieve for it in the future.

1 May 2012, 8:04 PM
#7
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Ship to only two countries

While there is not override for this file, you could customize the code in:
/includes/functions/functions_lookups.php

and, for example to only allow United States and Canada, around line 45 change the code from:

      $countries = "select countries_id, countries_name
                    from " . TABLE_COUNTRIES . "
                    order by countries_name";

to read:

      $countries = "select countries_id, countries_name
                    from " . TABLE_COUNTRIES . "
                    WHERE countries_iso_code_2 = 'US' or countries_iso_code_2 = 'CA'
                    order by countries_name";
2 May 2012, 3:47 PM
#8
onejimb avatar

onejimb

New Zenner

Join Date:
Apr 2009
Posts:
31
Plugin Contributions:
0

Re: Ship to only two countries

Code worked great, thanks

2 May 2012, 4:01 PM
#9
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Ship to only two countries

Thanks for the update that this was able to work for you ... :smile:

4 May 2012, 9:09 PM
#10
ryanloop avatar

ryanloop

New Zenner

Join Date:
Apr 2012
Posts:
12
Plugin Contributions:
0

Re: Ship to only two countries

One question: How I can configure a Zone Definition only for some specific users??

Because if I delete the database remain standard for all other users ...

Regards

4 May 2012, 9:17 PM
#11
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Ship to only two countries

Could you give more details on what it is you ar trying to do ... I am not following your brief description ... :unsure:

25 May 2012, 11:14 PM
#12
rssell avatar

rssell

New Zenner

Join Date:
May 2012
Posts:
6
Plugin Contributions:
0

Re: Ship to only two countries

1st post and new to ZC!

I do not use the estimate shipping module but I need to exclude many countries from shipping due to the regulations of U.S. Department of Commerce - Bureau of Industry and Security.

If I continue the code to be the below will it restrict countries *not on the list by ISO Code 2?

$countries = "select countries_id, countries_name
                    from " . TABLE_COUNTRIES . "
                    WHERE countries_iso_code_2 = 'US' or countries_iso_code_2 = 'CA', 'AU', 'AT', 'BE', 'BZ', 'CZ', ....etc
                    order by countries_name"; 
25 May 2012, 11:27 PM
#13
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Ship to only two countries

You would need to write this correctly for more countries ...

      $countries = "select countries_id, countries_name                     from " . TABLE_COUNTRIES . "                     WHERE countries_iso_code_2 = 'US' or countries_iso_code_2 = 'CA' or countries_iso_code_2 = 'AU' or countries_iso_code_2 = 'AT' etc. etc. etc.                     order by countries_name";
26 May 2012, 2:24 PM
#14
rssell avatar

rssell

New Zenner

Join Date:
May 2012
Posts:
6
Plugin Contributions:
0

Re: Ship to only two countries

Ajeh:

You would need to write this correctly for more countries ...

  $countries = "select countries_id, countries_name                     from " . TABLE_COUNTRIES . "                     WHERE countries_iso_code_2 = 'US' or countries_iso_code_2 = 'CA' or countries_iso_code_2 = 'AU' or countries_iso_code_2 = 'AT' etc. etc. etc.                     order by countries_name";

Thank you. I think I wrote it like you said but it's didn't work, all countries still appear as options. Is this right? Do I need to change or remove something else? Is it maybe allowing all countries by ISO Code 3 definition? I am using the ups.php module for shipping.

$countries = "select countries_id, countries_name
                  from " . TABLE_COUNTRIES . "
                  WHERE countries_iso_code_2 = 'US' or countries_iso_code_2 = 'CA' or countries_iso_code_2 = 'AU' or countries_iso_code_2 = 'AT' or countries_iso_code_2 = 'BE' or countries_iso_code_2 = 'BZ' or countries_iso_code_2 = 'CZ' or countries_iso_code_2 = 'DK' or countries_iso_code_2 = 'EE' or countries_iso_code_2 = 'FJ' or countries_iso_code_2 = 'FI' or countries_iso_code_2 = 'FR' or countries_iso_code_2 = 'DE' or countries_iso_code_2 = 'GR' or countries_iso_code_2 = 'GG' or countries_iso_code_2 = 'HK' or countries_iso_code_2 = 'HU' or countries_iso_code_2 = 'IS' or countries_iso_code_2 = 'IN' or countries_iso_code_2 = 'ID' or countries_iso_code_2 = 'IE' or countries_iso_code_2 = 'IM' or countries_iso_code_2 = 'IL' or countries_iso_code_2 = 'IT' or countries_iso_code_2 = 'JM' or countries_iso_code_2 = 'JP' or countries_iso_code_2 = 'KR' or countries_iso_code_2 = 'LV' or countries_iso_code_2 = 'LI' or countries_iso_code_2 = 'MY' or countries_iso_code_2 = 'MV' or countries_iso_code_2 = 'MU' or countries_iso_code_2 = 'MX' or countries_iso_code_2 = 'MC' or countries_iso_code_2 = 'NL' or countries_iso_code_2 = 'NZ' or countries_iso_code_2 = 'NO' or countries_iso_code_2 = 'PY' or countries_iso_code_2 = 'PU' or countries_iso_code_2 = 'PE' or countries_iso_code_2 = 'PH' or countries_iso_code_2 = 'PL' or countries_iso_code_2 = 'PT' or countries_iso_code_2 = 'PR' or countries_iso_code_2 = 'RO' or countries_iso_code_2 = 'RU' or countries_iso_code_2 = 'SC' or countries_iso_code_2 = 'SG' or countries_iso_code_2 = 'SK' or countries_iso_code_2 = 'SI' or countries_iso_code_2 = 'ZA' or countries_iso_code_2 = 'ES' or countries_iso_code_2 = 'SZ' or countries_iso_code_2 = 'SE' or countries_iso_code_2 = 'CH' or countries_iso_code_2 = 'TW' or countries_iso_code_2 = 'TH' or countries_iso_code_2 = 'TR' or countries_iso_code_2 = 'UA' or countries_iso_code_2 = 'AE' or countries_iso_code_2 = 'GB' or countries_iso_code_2 = 'UM' or countries_iso_code_2 = 'VN'
                  order by countries_name";
                
    $countries_values = $db->Execute($countries);

    $countries_array = array('countries_name' => $countries_values->fields['countries_name'],
                             'countries_iso_code_2' => $countries_values->fields['countries_iso_code_2'],
                             'countries_iso_code_3' => $countries_values->fields['countries_iso_code_3']);
26 May 2012, 2:30 PM
#15
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Ship to only two countries

Make sure you have it in the right place of the function zen_get_countries:

    } else {
/*
      $countries = "select countries_id, countries_name
                    from " . TABLE_COUNTRIES . "
                    order by countries_name";
*/
    $countries = "select countries_id, countries_name
                      from " . TABLE_COUNTRIES . "
                      WHERE countries_iso_code_2 = 'US' or countries_iso_code_2 = 'CA' or countries_iso_code_2 = 'AU' or countries_iso_code_2 = 'AT' or countries_iso_code_2 = 'BE' or countries_iso_code_2 = 'BZ' or countries_iso_code_2 = 'CZ' or countries_iso_code_2 = 'DK' or countries_iso_code_2 = 'EE' or countries_iso_code_2 = 'FJ' or countries_iso_code_2 = 'FI' or countries_iso_code_2 = 'FR' or countries_iso_code_2 = 'DE' or countries_iso_code_2 = 'GR' or countries_iso_code_2 = 'GG' or countries_iso_code_2 = 'HK' or countries_iso_code_2 = 'HU' or countries_iso_code_2 = 'IS' or countries_iso_code_2 = 'IN' or countries_iso_code_2 = 'ID' or countries_iso_code_2 = 'IE' or countries_iso_code_2 = 'IM' or countries_iso_code_2 = 'IL' or countries_iso_code_2 = 'IT' or countries_iso_code_2 = 'JM' or countries_iso_code_2 = 'JP' or countries_iso_code_2 = 'KR' or countries_iso_code_2 = 'LV' or countries_iso_code_2 = 'LI' or countries_iso_code_2 = 'MY' or countries_iso_code_2 = 'MV' or countries_iso_code_2 = 'MU' or countries_iso_code_2 = 'MX' or countries_iso_code_2 = 'MC' or countries_iso_code_2 = 'NL' or countries_iso_code_2 = 'NZ' or countries_iso_code_2 = 'NO' or countries_iso_code_2 = 'PY' or countries_iso_code_2 = 'PU' or countries_iso_code_2 = 'PE' or countries_iso_code_2 = 'PH' or countries_iso_code_2 = 'PL' or countries_iso_code_2 = 'PT' or countries_iso_code_2 = 'PR' or countries_iso_code_2 = 'RO' or countries_iso_code_2 = 'RU' or countries_iso_code_2 = 'SC' or countries_iso_code_2 = 'SG' or countries_iso_code_2 = 'SK' or countries_iso_code_2 = 'SI' or countries_iso_code_2 = 'ZA' or countries_iso_code_2 = 'ES' or countries_iso_code_2 = 'SZ' or countries_iso_code_2 = 'SE' or countries_iso_code_2 = 'CH' or countries_iso_code_2 = 'TW' or countries_iso_code_2 = 'TH' or countries_iso_code_2 = 'TR' or countries_iso_code_2 = 'UA' or countries_iso_code_2 = 'AE' or countries_iso_code_2 = 'GB' or countries_iso_code_2 = 'UM' or countries_iso_code_2 = 'VN'
                      order by countries_name";

      $countries_values = $db->Execute($countries);
26 May 2012, 3:04 PM
#16
rssell avatar

rssell

New Zenner

Join Date:
May 2012
Posts:
6
Plugin Contributions:
0

Re: Ship to only two countries

I think I did. :(

Lines 1-100:

<?php
/**
 * functions_lookups.php
 * Lookup Functions for various Zen Cart activities such as countries, prices, products, product types, etc
 *
 * @package functions
 * @copyright Copyright 2003-2011 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: functions_lookups.php 19352 2011-08-19 16:13:43Z ajeh $
 */


/**
 * Returns an array with countries
 *
 * @param int If set limits to a single country
 * @param boolean If true adds the iso codes to the array
*/
  function zen_get_countries($countries_id = '', $with_iso_codes = false) {
    global $db;
    $countries_array = array();
    if (zen_not_null($countries_id)) {
      if ($with_iso_codes == true) {

		$countries = "select countries_id, countries_name
                      from " . TABLE_COUNTRIES . "
                      WHERE countries_iso_code_2 = 'US' or countries_iso_code_2 = 'CA' or countries_iso_code_2 = 'AU' or countries_iso_code_2 = 'AT' or countries_iso_code_2 = 'BE' or countries_iso_code_2 = 'BZ' or countries_iso_code_2 = 'CZ' or countries_iso_code_2 = 'DK' or countries_iso_code_2 = 'EE' or countries_iso_code_2 = 'FJ' or countries_iso_code_2 = 'FI' or countries_iso_code_2 = 'FR' or countries_iso_code_2 = 'DE' or countries_iso_code_2 = 'GR' or countries_iso_code_2 = 'GG' or countries_iso_code_2 = 'HK' or countries_iso_code_2 = 'HU' or countries_iso_code_2 = 'IS' or countries_iso_code_2 = 'IN' or countries_iso_code_2 = 'ID' or countries_iso_code_2 = 'IE' or countries_iso_code_2 = 'IM' or countries_iso_code_2 = 'IL' or countries_iso_code_2 = 'IT' or countries_iso_code_2 = 'JM' or countries_iso_code_2 = 'JP' or countries_iso_code_2 = 'KR' or countries_iso_code_2 = 'LV' or countries_iso_code_2 = 'LI' or countries_iso_code_2 = 'MY' or countries_iso_code_2 = 'MV' or countries_iso_code_2 = 'MU' or countries_iso_code_2 = 'MX' or countries_iso_code_2 = 'MC' or countries_iso_code_2 = 'NL' or countries_iso_code_2 = 'NZ' or countries_iso_code_2 = 'NO' or countries_iso_code_2 = 'PY' or countries_iso_code_2 = 'PU' or countries_iso_code_2 = 'PE' or countries_iso_code_2 = 'PH' or countries_iso_code_2 = 'PL' or countries_iso_code_2 = 'PT' or countries_iso_code_2 = 'PR' or countries_iso_code_2 = 'RO' or countries_iso_code_2 = 'RU' or countries_iso_code_2 = 'SC' or countries_iso_code_2 = 'SG' or countries_iso_code_2 = 'SK' or countries_iso_code_2 = 'SI' or countries_iso_code_2 = 'ZA' or countries_iso_code_2 = 'ES' or countries_iso_code_2 = 'SZ' or countries_iso_code_2 = 'SE' or countries_iso_code_2 = 'CH' or countries_iso_code_2 = 'TW' or countries_iso_code_2 = 'TH' or countries_iso_code_2 = 'TR' or countries_iso_code_2 = 'UA' or countries_iso_code_2 = 'AE' or countries_iso_code_2 = 'GB' or countries_iso_code_2 = 'UM' or countries_iso_code_2 = 'VN'
                      order by countries_name";
                    
        $countries_values = $db->Execute($countries);

        $countries_array = array('countries_name' => $countries_values->fields['countries_name'],
                                 'countries_iso_code_2' => $countries_values->fields['countries_iso_code_2'],
                                 'countries_iso_code_3' => $countries_values->fields['countries_iso_code_3']);
      } else {
        $countries = "select countries_name
                      from " . TABLE_COUNTRIES . "
                      where countries_id = '" . (int)$countries_id . "'";

        $countries_values = $db->Execute($countries);

        $countries_array = array('countries_name' => $countries_values->fields['countries_name']);
      }
    } else {
      $countries = "select countries_id, countries_name
                    from " . TABLE_COUNTRIES . "
                    order by countries_name";

      $countries_values = $db->Execute($countries);

      while (!$countries_values->EOF) {
        $countries_array[] = array('countries_id' => $countries_values->fields['countries_id'],
                                   'countries_name' => $countries_values->fields['countries_name']);

        $countries_values->MoveNext();
      }
    }

    return $countries_array;
  }

/*
 *  Alias function to zen_get_countries()
 */
  function zen_get_country_name($country_id) {
    $country_array = zen_get_countries($country_id);

    return $country_array['countries_name'];
  }

/**
 * Alias function to zen_get_countries, which also returns the countries iso codes
 *
 * @param int If set limits to a single country
*/
  function zen_get_countries_with_iso_codes($countries_id) {
    return zen_get_countries($countries_id, true);
  }

/*
 * Return the zone (State/Province) name
 * TABLES: zones
 */
  function zen_get_zone_name($country_id, $zone_id, $default_zone) {
    global $db;
    $zone_query = "select zone_name
                   from " . TABLE_ZONES . "
                   where zone_country_id = '" . (int)$country_id . "'
                   and zone_id = '" . (int)$zone_id . "'";

    $zone = $db->Execute($zone_query);

    if ($zone->RecordCount()) {
      return $zone->fields['zone_name'];
    } else {
      return $default_zone;
    }
  }
26 May 2012, 3:14 PM
#17
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Ship to only two countries

Put your code changes in the SELECT after the ELSE you have it in the first part of the IF statement ...

Look at the code I posted to see the difference ...

26 May 2012, 3:26 PM
#18
rssell avatar

rssell

New Zenner

Join Date:
May 2012
Posts:
6
Plugin Contributions:
0

Re: Ship to only two countries

And..... problem solved. Thanks!

26 May 2012, 3:30 PM
#19
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Ship to only two countries

You are most welcome ... thanks for the update that this is now working for you ... :smile:

15 Jun 2012, 4:49 AM
#20
batracy avatar

batracy

New Zenner

Join Date:
Jun 2012
Posts:
57
Plugin Contributions:
1

Re: Ship to only two countries

I am in the process of setting up my store and needed to adjust or select which countries I will ship to. I have a US store and there are some restrictions as to the countries I can ship to. I thought that deleting countries from the database was not an acceptable solution because I may need to add them back, and making such a long selection in the database select code as above gets rather messy. Since the ability to turn on or off countries is not currently implemented, I took it upon myself to implement this feature which turned out to be easier than I thought it would be. Here's what I did:

First, I added a new field to the countries table in the database: countries_active char(1) default 1
I used phpMyAdmin to make the change as it was very easy with this tool and it defaulted all existing entries in the table.

Next I changed the includes/functions/function_lookup.php file and added a where clause to each of the select statements for the countries lookup:

      $countries = "select countries_id, countries_name
                    from " . TABLE_COUNTRIES . "
                    where countries_active > '0' 
                    order by countries_name";

Next I added a constant to admin/includes/languages/countries.php :

define('TEXT_INFO_COUNTRY_ACTIVE', 'Ship to Country?');

The final step is the biggest one, lot of changes to admin/countries.php. First is the update the action steps (these are at the top of the file):

    switch ($action) {
      case 'insert':
        $countries_name = zen_db_prepare_input($_POST['countries_name']);
        $countries_iso_code_2 = zen_db_prepare_input($_POST['countries_iso_code_2']);
        $countries_iso_code_3 = zen_db_prepare_input($_POST['countries_iso_code_3']);
        $address_format_id = zen_db_prepare_input($_POST['address_format_id']);
        $countries_active = zen_db_prepare_input($_POST['countries_active']);

        $db->Execute("insert into " . TABLE_COUNTRIES . "
                    (countries_name, countries_iso_code_2, countries_iso_code_3, address_format_id, countries_active)
                    values ('" . zen_db_input($countries_name) . "',
                            '" . zen_db_input($countries_iso_code_2) . "',
                            '" . zen_db_input($countries_iso_code_3) . "',
                            '" . (int)$address_format_id . "',
                            '" . (zen_db_input($countries_active) > '' ? 1 : 0) . "')");

        zen_redirect(zen_href_link(FILENAME_COUNTRIES));
        break;
      case 'save':
        $countries_id = zen_db_prepare_input($_GET['cID']);
        $countries_name = zen_db_prepare_input($_POST['countries_name']);
        $countries_iso_code_2 = zen_db_prepare_input($_POST['countries_iso_code_2']);
        $countries_iso_code_3 = zen_db_prepare_input($_POST['countries_iso_code_3']);
        $address_format_id = zen_db_prepare_input($_POST['address_format_id']);
        $countries_active = zen_db_prepare_input($_POST['countries_active']);

        $db->Execute("update " . TABLE_COUNTRIES . "
                      set countries_name = '" . zen_db_input($countries_name) . "',
                          countries_iso_code_2 = '" . zen_db_input($countries_iso_code_2) . "',
                          countries_iso_code_3 = '" . zen_db_input($countries_iso_code_3) . "',
                          address_format_id = '" . (int)$address_format_id . "',
                          countries_active = '" . (zen_db_input($countries_active) > '' ? 1 : 0) . "'
                      where countries_id = '" . (int)$countries_id . "'");

        zen_redirect(zen_href_link(FILENAME_COUNTRIES, 'page=' . $_GET['page'] . '&cID=' . $countries_id));
        break;

Note the added lines:

$countries_active = zen_db_prepare_input($_POST['countries_active']);

'countries_active = '" .(zen_db_input($countries_active) > '' ? 1 : 0) . "'

Then I made changes to the bottom part of the file that displays and allows for editing within the admin screen:
Note the lines added for 'countries_active'

  switch ($action) {
    case 'new':
      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_NEW_COUNTRY . '</b>');

      $contents = array('form' => zen_draw_form('countries', FILENAME_COUNTRIES, 'page=' . $_GET['page'] . '&action=insert'));
      $contents[] = array('text' => TEXT_INFO_INSERT_INTRO);
      $contents[] = array('text' => '<br>' . TEXT_INFO_COUNTRY_NAME . '<br>' . zen_draw_input_field('countries_name'));
      $contents[] = array('text' => '<br>' . TEXT_INFO_COUNTRY_CODE_2 . '<br>' . zen_draw_input_field('countries_iso_code_2'));
      $contents[] = array('text' => '<br>' . TEXT_INFO_COUNTRY_CODE_3 . '<br>' . zen_draw_input_field('countries_iso_code_3'));
      $contents[] = array('text' => '<br>' . TEXT_INFO_ADDRESS_FORMAT . '<br>' . zen_draw_pull_down_menu('address_format_id', zen_get_address_formats()));
      $contents[] = array('text' => '<br>' . TEXT_INFO_COUNTRY_ACTIVE . '<br>' . zen_draw_checkbox_field('countries_active', '', true));
      $contents[] = array('align' => 'center', 'text' => '<br>' . zen_image_submit('button_insert.gif', IMAGE_INSERT) . ' <a href="' . zen_href_link(FILENAME_COUNTRIES, 'page=' . $_GET['page']) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
      break;
    case 'edit':
      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_EDIT_COUNTRY . '</b>');

      $contents = array('form' => zen_draw_form('countries', FILENAME_COUNTRIES, 'page=' . $_GET['page'] . '&cID=' . $cInfo->countries_id . '&action=save'));
      $contents[] = array('text' => TEXT_INFO_EDIT_INTRO);
      $contents[] = array('text' => '<br>' . TEXT_INFO_COUNTRY_NAME . '<br>' . zen_draw_input_field('countries_name', htmlspecialchars($cInfo->countries_name, ENT_COMPAT, CHARSET, TRUE)));
      $contents[] = array('text' => '<br>' . TEXT_INFO_COUNTRY_CODE_2 . '<br>' . zen_draw_input_field('countries_iso_code_2', $cInfo->countries_iso_code_2));
      $contents[] = array('text' => '<br>' . TEXT_INFO_COUNTRY_CODE_3 . '<br>' . zen_draw_input_field('countries_iso_code_3', $cInfo->countries_iso_code_3));
      $contents[] = array('text' => '<br>' . TEXT_INFO_ADDRESS_FORMAT . '<br>' . zen_draw_pull_down_menu('address_format_id', zen_get_address_formats(), $cInfo->address_format_id));
      $contents[] = array('text' => '<br>' . TEXT_INFO_COUNTRY_ACTIVE . '<br>' . zen_draw_checkbox_field('countries_active', $cInfo->countries_active, $cInfo->countries_active));
      $contents[] = array('align' => 'center', 'text' => '<br>' . zen_image_submit('button_update.gif', IMAGE_UPDATE) . ' <a href="' . zen_href_link(FILENAME_COUNTRIES, 'page=' . $_GET['page'] . '&cID=' . $cInfo->countries_id) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
      break;
    case 'delete':
      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_COUNTRY . '</b>');

      $contents = array('form' => zen_draw_form('countries', FILENAME_COUNTRIES, 'page=' . $_GET['page'] . '&action=deleteconfirm') . zen_draw_hidden_field('cID', $cInfo->countries_id));
      $contents[] = array('text' => TEXT_INFO_DELETE_INTRO);
      $contents[] = array('text' => '<br><b>' . $cInfo->countries_name . '</b>');
      $contents[] = array('align' => 'center', 'text' => '<br>' . zen_image_submit('button_delete.gif', IMAGE_UPDATE) . ' <a href="' . zen_href_link(FILENAME_COUNTRIES, 'page=' . $_GET['page'] . '&cID=' . $cInfo->countries_id) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
      break;
    default:
      if (is_object($cInfo)) {
        $heading[] = array('text' => '<b>' . $cInfo->countries_name . '</b>');

        $contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link(FILENAME_COUNTRIES, 'page=' . $_GET['page'] . '&cID=' . $cInfo->countries_id . '&action=edit') . '">' . zen_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . zen_href_link(FILENAME_COUNTRIES, 'page=' . $_GET['page'] . '&cID=' . $cInfo->countries_id . '&action=delete') . '">' . zen_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
        $contents[] = array('text' => '<br>' . TEXT_INFO_COUNTRY_NAME . '<br>' . $cInfo->countries_name);
        $contents[] = array('text' => '<br>' . TEXT_INFO_COUNTRY_CODE_2 . ' ' . $cInfo->countries_iso_code_2);
        $contents[] = array('text' => '<br>' . TEXT_INFO_COUNTRY_CODE_3 . ' ' . $cInfo->countries_iso_code_3);
        $contents[] = array('text' => '<br>' . TEXT_INFO_ADDRESS_FORMAT . ' ' . $cInfo->address_format_id);
        $contents[] = array('text' => '<br>' . TEXT_INFO_COUNTRY_ACTIVE . '<br>' . zen_draw_checkbox_field('countries_active', '', $cInfo->countries_active));
      }
      break;
  }

This now allows me to turn on or off the countries I ship to without having to delete entries from the database. Hopefully this will help others with this issue.