If this is your first visit, check our documentation. To post, register or login.

Blank Sub Zones

Started by satinwoods on 8 Jan 2013, 11:49 PM · Views: 1,099

Results 1 to 4 of 4
8 Jan 2013, 11:49 PM
#1
satinwoods avatar

satinwoods

New Zenner

Join Date:
Jan 2013
Posts:
3
Plugin Contributions:
0

Blank Sub Zones

I've looked over the tutorials and I think I must be missing something or something has broke.

When I get to step (2) for the sub zones, the drop down for Country is blank entirely and the zones drop down only says "all zones"

Did I miss something? :(

9 Jan 2013, 2:48 AM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Blank Sub Zones

When you reply - scroll up and read posting tips then provide information

Zen-Venom Get Bitten

11 Jan 2013, 12:06 AM
#3
satinwoods avatar

satinwoods

New Zenner

Join Date:
Jan 2013
Posts:
3
Plugin Contributions:
0

Re: Blank Sub Zones

What version of Zen Cart?
Zen Cart 1.3.8a
Is it a new install or an upgrade?
Upgrade
What the addons/contributions you have installed?

  • Fast Easy Checkout
  • Store Credit
  • Stock by Attribute
    What customizations have you made?
    None.
    What type of server are you using?
    Linux 2.6.32-279.9.1.el6.x86_64
    Are you installing locally?
    No
    What operating system?
    Windows 64x
    What version of PHP is installed on the server?
    5.2.17 (Zend: 2.2.0)
    What version of MYSQL is installed on the server?
    MySQL 5.5.28-cll
    What you were doing when your problem occurred?
    Attempting to correct the tax rates for various provinces
    What are the steps to reproduce the problem?
    Follow proper steps found here -> http://www.zen-cart.com/showthread.php?35032-Configuring-Taxes-for-Canadian-Sites-Zones
    Have you attempted to fix the problem?
    No
    What steps have you taken?
    Not sure where to begin as this did work when I first installed zencart and has been running smoothly for 2 years. I have not touched anything to do with taxes and now gives me blank pull downs.
11 Jan 2013, 2:13 AM
#4
satinwoods avatar

satinwoods

New Zenner

Join Date:
Jan 2013
Posts:
3
Plugin Contributions:
0

Re: Blank Sub Zones

Never mind, I fixed it. This new function wasn't working so I had to use the old one that was commented out for some reason.

This is the broken code. I have no idea where this came from and why a working version was commented out. I'm the only one that works on this site.

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_name, countries_iso_code_2, countries_iso_code_3 
                      from " . TABLE_COUNTRIES . " 
                      where countries_id = '" . (int)$countries_id . "' 
                      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_array[] = array('id' => $countries_values->fields['countries_id'],
                                 'text' => $countries_values->fields['countries_name']);
        $countries_values->MoveNext();
      }
    }

    return $countries_array;
  }