Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    Join Date
    Jul 2007
    Location
    Jakarta
    Posts
    358
    Plugin Contributions
    0

    help question Error installing cloned zone shipping module

    I've followed the instructions in http://www.zen-cart.com/forum/showthread.php?t=26216

    But when installing the newly cloned shipping module the following error is displayed.

    Code:
    Warning:  reset() [function.reset]: Passed variable is not an array or object in /home/alifina/public_html/boutique/admin/modules.php on line 279
    
    Warning:  Variable passed to each() is not an array or object in /home/alifina/public_html/boutique/admin/modules.php on line 280
    
    Did I miss something?

    thanks

  2. #2
    Join Date
    Jul 2007
    Location
    Jakarta
    Posts
    358
    Plugin Contributions
    0

    Default Re: Error installing cloned zone shipping module

    Anyone know why this error message appears? What did i miss?

  3. #3
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Error installing cloned zone shipping module

    What name did you give your new cloned shipping module?

    Did you do the replacements as case sensative changes?

    What happens if you delete your new cloned shipping module from the:
    /includes/modules/shipping

    NOTE: be sure you have a backup ...

    NOTE: make sure you do NOT have extra files in this self loading directory ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  4. #4
    Join Date
    Jul 2007
    Location
    Jakarta
    Posts
    358
    Plugin Contributions
    0

    Default Re: Error installing cloned zone shipping module

    1. I copied includes/modules/shipping/zones.php to EMS.php (same directory).
    2. I then replace occurencess of 'zones' and 'ZONES' to ems and EMS respectively.

    this is the EMS.php file
    Code:
     class ems {
    
        var $code, $title, $description, $enabled, $num_zones;
    
    
    
    // class constructor
    
        function ems() {
    
          $this->code = 'ems';
    
          $this->title = MODULE_SHIPPING_EMS_TEXT_TITLE;
    
          $this->description = MODULE_SHIPPING_EMS_TEXT_DESCRIPTION;
    
          $this->sort_order = MODULE_SHIPPING_EMS_SORT_ORDER;
    
          $this->icon = '';
    
          $this->tax_class = MODULE_SHIPPING_EMS_TAX_CLASS;
    
          $this->tax_basis = MODULE_SHIPPING_EMS_TAX_BASIS;
    
    
    
          // disable only when entire cart is free shipping
    
          if (zen_get_shipping_enabled($this->code)) {
    
            $this->enabled = ((MODULE_SHIPPING_EMS_STATUS == 'True') ? true : false);
    
          }
    
    
    
          // CUSTOMIZE THIS SETTING FOR THE NUMBER OF ZONES NEEDED
    
          $this->num_zones = 3;
    
        }
    
    
    
    // class methods
    
        function quote($method = '') {
    
          global $order, $shipping_weight, $shipping_num_boxes, $total_count;
    
          $dest_country = $order->delivery['country']['iso_code_2'];
    
          $dest_zone = 0;
    
          $error = false;
    
    
    
          for ($i=1; $i<=$this->num_zones; $i++) {
    
            $countries_table = constant('MODULE_SHIPPING_EMS_COUNTRIES_' . $i);
    
            $countries_table = strtoupper(str_replace(' ', '', $countries_table));
    
            $country_zones = split("[,]", $countries_table);
    
            if (in_array($dest_country, $country_zones)) {
    
              $dest_zone = $i;
    
              break;
    
            }
    
            if (in_array('00', $country_zones)) {
    
              $dest_zone = $i;
    
              break;
    
            }
    
          }
    
    
    
          if ($dest_zone == 0) {
    
            $error = true;
    
          } else {
    
            $shipping = -1;
    
            $zones_cost = constant('MODULE_SHIPPING_EMS_COST_' . $dest_zone);
    
    
    
            $zones_table = split("[:,]" , $zones_cost);
    
            $size = sizeof($zones_table);
    
            $done = false;
    
            for ($i=0; $i<$size; $i+=2) {
    
              switch (MODULE_SHIPPING_EMS_METHOD) {
    
                  case (MODULE_SHIPPING_EMS_METHOD == 'Weight'):
    
                  if (round($shipping_weight,9) <= $zones_table[$i]) {
    
                    $shipping = $zones_table[$i+1];
    
    
    
                    switch (SHIPPING_BOX_WEIGHT_DISPLAY) {
    
                    case (0):
    
                      $show_box_weight = '';
    
                      break;
    
                    case (1):
    
                      $show_box_weight = ' (' . $shipping_num_boxes . ' ' . TEXT_SHIPPING_BOXES . ')';
    
                      break;
    
                    case (2):
    
                      $show_box_weight = ' (' . number_format($shipping_weight * $shipping_num_boxes,2) . MODULE_SHIPPING_EMS_TEXT_UNITS . ')';
    
                      break;
    
                    default:
    
                      $show_box_weight = ' (' . $shipping_num_boxes . ' x ' . number_format($shipping_weight,2) . MODULE_SHIPPING_EMS_TEXT_UNITS . ')';
    
                      break;
    
                    }
    
    
    
    //                $shipping_method = MODULE_SHIPPING_EMS_TEXT_WAY . ' ' . $dest_country . (SHIPPING_BOX_WEIGHT_DISPLAY >= 2 ? ' : ' . $shipping_weight . ' ' . MODULE_SHIPPING_EMS_TEXT_UNITS : '');
    
                    $shipping_method = MODULE_SHIPPING_EMS_TEXT_WAY . ' ' . $dest_country . $show_box_weight;
    
                    $done = true;
    
                    break;
    
                    }
    
                  break;
    
                  case (MODULE_SHIPPING_EMS_METHOD == 'Price'):
    
    // shipping adjustment
    
                  if (($_SESSION['cart']->show_total() - $_SESSION['cart']->free_shipping_prices()) <= $zones_table[$i]) {
    
                    $shipping = $zones_table[$i+1];
    
                    $shipping_method = MODULE_SHIPPING_EMS_TEXT_WAY . ' ' . $dest_country;
    
                    $done = true;
    
                    break;
    
                    }
    
                  break;
    
                  case (MODULE_SHIPPING_EMS_METHOD == 'Item'):
    
    // shipping adjustment
    
                  if (($total_count - $_SESSION['cart']->free_shipping_items()) <= $zones_table[$i]) {
    
                    $shipping = $zones_table[$i+1];
    
                    $shipping_method = MODULE_SHIPPING_EMS_TEXT_WAY . ' ' . $dest_country;
    
                    $done = true;
    
                    break;
    
                    }
    
                  break;
    
              }
    
              if ($done == true) {
    
                break;
    
              }
    
            }
    
    
    
            if ($shipping == -1) {
    
              $shipping_cost = 0;
    
              $shipping_method = MODULE_SHIPPING_EMS_UNDEFINED_RATE;
    
            } else {
    
              switch (MODULE_SHIPPING_EMS_METHOD) {
    
                  case (MODULE_SHIPPING_EMS_METHOD == 'Weight'):
    
                  // charge per box when done by Price
    
                  $shipping_cost = ($shipping * $shipping_num_boxes) + constant('MODULE_SHIPPING_EMS_HANDLING_' . $dest_zone);
    
                  break;
    
                  case (MODULE_SHIPPING_EMS_METHOD == 'Price'):
    
                  // don't charge per box when done by Price
    
                  $shipping_cost = ($shipping) + constant('MODULE_SHIPPING_EMS_HANDLING_' . $dest_zone);
    
                break;
    
                  case (MODULE_SHIPPING_EMS_METHOD == 'Item'):
    
                  // don't charge per box when done by Item
    
                  $shipping_cost = ($shipping) + constant('MODULE_SHIPPING_EMS_HANDLING_' . $dest_zone);
    
                break;
    
              }
    
            }
    
          }
    
          $this->quotes = array('id' => $this->code,
    
                                'module' => MODULE_SHIPPING_EMS_TEXT_TITLE,
    
                                'methods' => array(array('id' => $this->code,
    
                                                         'title' => $shipping_method,
    
                                                         'cost' => $shipping_cost)));
    
    
    
          if ($this->tax_class > 0) {
    
            $this->quotes['tax'] = zen_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
    
          }
    
    
    
          if (zen_not_null($this->icon)) $this->quotes['icon'] = zen_image($this->icon, $this->title);
    
    
    
          if (strstr(MODULE_SHIPPING_EMS_SKIPPED, $dest_country)) {
    
            // don't show anything for this country
    
            $this->quotes = array();
    
          } else {
    
            if ($error == true) $this->quotes['error'] = MODULE_SHIPPING_EMS_INVALID_ZONE;
    
          }
    
    
    
          return $this->quotes;
    
        }
    
    
    
        function check() {
    
          global $db;
    
          if (!isset($this->_check)) {
    
            $check_query = $db->Execute("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_EMS_STATUS'");
    
            $this->_check = $check_query->RecordCount();
    
          }
    
          return $this->_check;
    
        }
    
    
    
        function install() {
    
          global $db;
    
          $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Enable EMS Method', 'MODULE_SHIPPING_EMS_STATUS', 'True', 'Do you want to offer EMS rate shipping?', '6', '0', 'zen_cfg_select_option(array(\'True\', \'False\'), ', now())");
    
          $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Calculation Method', 'MODULE_SHIPPING_EMS_METHOD', 'Weight', 'Calculate cost based on Weight, Price or Item?', '6', '0', 'zen_cfg_select_option(array(\'Weight\', \'Price\', \'Item\'), ', now())");
    
          $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Tax Class', 'MODULE_SHIPPING_EMS_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'zen_get_tax_class_title', 'zen_cfg_pull_down_tax_classes(', now())");
    
          $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Tax Basis', 'MODULE_SHIPPING_EMS_TAX_BASIS', 'Shipping', 'On what basis is Shipping Tax calculated. Options are<br />Shipping - Based on customers Shipping Address<br />Billing Based on customers Billing address<br />Store - Based on Store address if Billing/Shipping Zone equals Store zone', '6', '0', 'zen_cfg_select_option(array(\'Shipping\', \'Billing\', \'Store\'), ', now())");
    
          $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_SHIPPING_EMS_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())");
    
          $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Skip Countries, use a comma separated list of the two character ISO country codes', 'MODULE_SHIPPING_EMS_SKIPPED', '', 'Disable for the following Countries:', '6', '0', 'zen_cfg_textarea(', now())");
    
    
    
          for ($i = 1; $i <= $this->num_zones; $i++) {
    
            $default_countries = '';
    
            if ($i == 1) {
    
              $default_countries = 'US,CA';
    
            }
    
            $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Zone " . $i ." Countries', 'MODULE_SHIPPING_EMS_COUNTRIES_" . $i ."', '" . $default_countries . "', 'Comma separated list of two character ISO country codes that are part of Zone " . $i . ".<br />Set as 00 to indicate all two character ISO country codes that are not specifically defined.', '6', '0', 'zen_cfg_textarea(', now())");
    
            $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Zone " . $i ." Shipping Table', 'MODULE_SHIPPING_EMS_COST_" . $i ."', '3:8.50,7:10.50,99:20.00', 'Shipping rates to Zone " . $i . " destinations based on a group of maximum order weights/prices. Example: 3:8.50,7:10.50,... Weight/Price less than or equal to 3 would cost 8.50 for Zone " . $i . " destinations.', '6', '0', 'zen_cfg_textarea(', now())");
    
            $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Zone " . $i ." Handling Fee', 'MODULE_SHIPPING_EMS_HANDLING_" . $i."', '0', 'Handling Fee for this shipping zone', '6', '0', now())");
    
          }
    
        }
    
    
    
        function remove() {
    
          global $db;
    
          $db->Execute("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
    
        }
    
    
    
        function keys() {
    
          $keys = array('MODULE_SHIPPING_EMS_STATUS', 'MODULE_SHIPPING_EMS_METHOD', 'MODULE_SHIPPING_EMS_TAX_CLASS', 'MODULE_SHIPPING_EMS_TAX_BASIS', 'MODULE_SHIPPING_EMS_SORT_ORDER', 'MODULE_SHIPPING_EMS_SKIPPED');
    
    
    
          for ($i=1; $i<=$this->num_zones; $i++) {
    
            $keys[] = 'MODULE_SHIPPING_EMS_COUNTRIES_' . $i;
    
            $keys[] = 'MODULE_SHIPPING_EMS_COST_' . $i;
    
            $keys[] = 'MODULE_SHIPPING_EMS_HANDLING_' . $i;
    
          }
    
    
    
          return $keys;
    
        }
    
      }
    If I delete the EMS.php file, the EMS shipping module doesn't display under Admin > Modules > Shipping

    Thanks for your attention

  5. #5
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Error installing cloned zone shipping module

    EMS.php should be ems.php ...

    Filenames are case sensative ...

    Did you cut off the top and bottom of the file for this? Or is that really missing?
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  6. #6
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Error installing cloned zone shipping module

    Also, what version Zen Cart are you running?
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  7. #7
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Error installing cloned zone shipping module

    Quote Originally Posted by shocker View Post
    1. I copied includes/modules/shipping/zones.php to EMS.php (same directory).
    2. I then replace occurencess of 'zones' and 'ZONES' to ems and EMS respectively.

    this is the EMS.php file
    Code:
     class ems {
    
        var $code, $title, $description, $enabled, $num_zones;
    
    
    
    // class constructor
    
        function ems() {
    
          $this->code = 'ems';
    
          $this->title = MODULE_SHIPPING_EMS_TEXT_TITLE;
    
          $this->description = MODULE_SHIPPING_EMS_TEXT_DESCRIPTION;
    
          $this->sort_order = MODULE_SHIPPING_EMS_SORT_ORDER;
    
          $this->icon = '';
    
          $this->tax_class = MODULE_SHIPPING_EMS_TAX_CLASS;
    
          $this->tax_basis = MODULE_SHIPPING_EMS_TAX_BASIS;
    
    
    
          // disable only when entire cart is free shipping
    
          if (zen_get_shipping_enabled($this->code)) {
    
            $this->enabled = ((MODULE_SHIPPING_EMS_STATUS == 'True') ? true : false);
    
          }
    
    
    
          // CUSTOMIZE THIS SETTING FOR THE NUMBER OF ZONES NEEDED
    
          $this->num_zones = 3;
    
        }
    
    
    
    // class methods
    
        function quote($method = '') {
    
          global $order, $shipping_weight, $shipping_num_boxes, $total_count;
    
          $dest_country = $order->delivery['country']['iso_code_2'];
    
          $dest_zone = 0;
    
          $error = false;
    
    
    
          for ($i=1; $i<=$this->num_zones; $i++) {
    
            $countries_table = constant('MODULE_SHIPPING_EMS_COUNTRIES_' . $i);
    
            $countries_table = strtoupper(str_replace(' ', '', $countries_table));
    
            $country_zones = split("[,]", $countries_table);
    
            if (in_array($dest_country, $country_zones)) {
    
              $dest_zone = $i;
    
              break;
    
            }
    
            if (in_array('00', $country_zones)) {
    
              $dest_zone = $i;
    
              break;
    
            }
    
          }
    
    
    
          if ($dest_zone == 0) {
    
            $error = true;
    
          } else {
    
            $shipping = -1;
    
            $zones_cost = constant('MODULE_SHIPPING_EMS_COST_' . $dest_zone);
    
    
    
            $zones_table = split("[:,]" , $zones_cost);
    
            $size = sizeof($zones_table);
    
            $done = false;
    
            for ($i=0; $i<$size; $i+=2) {
    
              switch (MODULE_SHIPPING_EMS_METHOD) {
    
                  case (MODULE_SHIPPING_EMS_METHOD == 'Weight'):
    
                  if (round($shipping_weight,9) <= $zones_table[$i]) {
    
                    $shipping = $zones_table[$i+1];
    
    
    
                    switch (SHIPPING_BOX_WEIGHT_DISPLAY) {
    
                    case (0):
    
                      $show_box_weight = '';
    
                      break;
    
                    case (1):
    
                      $show_box_weight = ' (' . $shipping_num_boxes . ' ' . TEXT_SHIPPING_BOXES . ')';
    
                      break;
    
                    case (2):
    
                      $show_box_weight = ' (' . number_format($shipping_weight * $shipping_num_boxes,2) . MODULE_SHIPPING_EMS_TEXT_UNITS . ')';
    
                      break;
    
                    default:
    
                      $show_box_weight = ' (' . $shipping_num_boxes . ' x ' . number_format($shipping_weight,2) . MODULE_SHIPPING_EMS_TEXT_UNITS . ')';
    
                      break;
    
                    }
    
    
    
    //                $shipping_method = MODULE_SHIPPING_EMS_TEXT_WAY . ' ' . $dest_country . (SHIPPING_BOX_WEIGHT_DISPLAY >= 2 ? ' : ' . $shipping_weight . ' ' . MODULE_SHIPPING_EMS_TEXT_UNITS : '');
    
                    $shipping_method = MODULE_SHIPPING_EMS_TEXT_WAY . ' ' . $dest_country . $show_box_weight;
    
                    $done = true;
    
                    break;
    
                    }
    
                  break;
    
                  case (MODULE_SHIPPING_EMS_METHOD == 'Price'):
    
    // shipping adjustment
    
                  if (($_SESSION['cart']->show_total() - $_SESSION['cart']->free_shipping_prices()) <= $zones_table[$i]) {
    
                    $shipping = $zones_table[$i+1];
    
                    $shipping_method = MODULE_SHIPPING_EMS_TEXT_WAY . ' ' . $dest_country;
    
                    $done = true;
    
                    break;
    
                    }
    
                  break;
    
                  case (MODULE_SHIPPING_EMS_METHOD == 'Item'):
    
    // shipping adjustment
    
                  if (($total_count - $_SESSION['cart']->free_shipping_items()) <= $zones_table[$i]) {
    
                    $shipping = $zones_table[$i+1];
    
                    $shipping_method = MODULE_SHIPPING_EMS_TEXT_WAY . ' ' . $dest_country;
    
                    $done = true;
    
                    break;
    
                    }
    
                  break;
    
              }
    
              if ($done == true) {
    
                break;
    
              }
    
            }
    
    
    
            if ($shipping == -1) {
    
              $shipping_cost = 0;
    
              $shipping_method = MODULE_SHIPPING_EMS_UNDEFINED_RATE;
    
            } else {
    
              switch (MODULE_SHIPPING_EMS_METHOD) {
    
                  case (MODULE_SHIPPING_EMS_METHOD == 'Weight'):
    
                  // charge per box when done by Price
    
                  $shipping_cost = ($shipping * $shipping_num_boxes) + constant('MODULE_SHIPPING_EMS_HANDLING_' . $dest_zone);
    
                  break;
    
                  case (MODULE_SHIPPING_EMS_METHOD == 'Price'):
    
                  // don't charge per box when done by Price
    
                  $shipping_cost = ($shipping) + constant('MODULE_SHIPPING_EMS_HANDLING_' . $dest_zone);
    
                break;
    
                  case (MODULE_SHIPPING_EMS_METHOD == 'Item'):
    
                  // don't charge per box when done by Item
    
                  $shipping_cost = ($shipping) + constant('MODULE_SHIPPING_EMS_HANDLING_' . $dest_zone);
    
                break;
    
              }
    
            }
    
          }
    
          $this->quotes = array('id' => $this->code,
    
                                'module' => MODULE_SHIPPING_EMS_TEXT_TITLE,
    
                                'methods' => array(array('id' => $this->code,
    
                                                         'title' => $shipping_method,
    
                                                         'cost' => $shipping_cost)));
    
    
    
          if ($this->tax_class > 0) {
    
            $this->quotes['tax'] = zen_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
    
          }
    
    
    
          if (zen_not_null($this->icon)) $this->quotes['icon'] = zen_image($this->icon, $this->title);
    
    
    
          if (strstr(MODULE_SHIPPING_EMS_SKIPPED, $dest_country)) {
    
            // don't show anything for this country
    
            $this->quotes = array();
    
          } else {
    
            if ($error == true) $this->quotes['error'] = MODULE_SHIPPING_EMS_INVALID_ZONE;
    
          }
    
    
    
          return $this->quotes;
    
        }
    
    
    
        function check() {
    
          global $db;
    
          if (!isset($this->_check)) {
    
            $check_query = $db->Execute("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_EMS_STATUS'");
    
            $this->_check = $check_query->RecordCount();
    
          }
    
          return $this->_check;
    
        }
    
    
    
        function install() {
    
          global $db;
    
          $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Enable EMS Method', 'MODULE_SHIPPING_EMS_STATUS', 'True', 'Do you want to offer EMS rate shipping?', '6', '0', 'zen_cfg_select_option(array(\'True\', \'False\'), ', now())");
    
          $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Calculation Method', 'MODULE_SHIPPING_EMS_METHOD', 'Weight', 'Calculate cost based on Weight, Price or Item?', '6', '0', 'zen_cfg_select_option(array(\'Weight\', \'Price\', \'Item\'), ', now())");
    
          $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Tax Class', 'MODULE_SHIPPING_EMS_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'zen_get_tax_class_title', 'zen_cfg_pull_down_tax_classes(', now())");
    
          $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Tax Basis', 'MODULE_SHIPPING_EMS_TAX_BASIS', 'Shipping', 'On what basis is Shipping Tax calculated. Options are<br />Shipping - Based on customers Shipping Address<br />Billing Based on customers Billing address<br />Store - Based on Store address if Billing/Shipping Zone equals Store zone', '6', '0', 'zen_cfg_select_option(array(\'Shipping\', \'Billing\', \'Store\'), ', now())");
    
          $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_SHIPPING_EMS_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())");
    
          $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Skip Countries, use a comma separated list of the two character ISO country codes', 'MODULE_SHIPPING_EMS_SKIPPED', '', 'Disable for the following Countries:', '6', '0', 'zen_cfg_textarea(', now())");
    
    
    
          for ($i = 1; $i <= $this->num_zones; $i++) {
    
            $default_countries = '';
    
            if ($i == 1) {
    
              $default_countries = 'US,CA';
    
            }
    
            $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Zone " . $i ." Countries', 'MODULE_SHIPPING_EMS_COUNTRIES_" . $i ."', '" . $default_countries . "', 'Comma separated list of two character ISO country codes that are part of Zone " . $i . ".<br />Set as 00 to indicate all two character ISO country codes that are not specifically defined.', '6', '0', 'zen_cfg_textarea(', now())");
    
            $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Zone " . $i ." Shipping Table', 'MODULE_SHIPPING_EMS_COST_" . $i ."', '3:8.50,7:10.50,99:20.00', 'Shipping rates to Zone " . $i . " destinations based on a group of maximum order weights/prices. Example: 3:8.50,7:10.50,... Weight/Price less than or equal to 3 would cost 8.50 for Zone " . $i . " destinations.', '6', '0', 'zen_cfg_textarea(', now())");
    
            $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Zone " . $i ." Handling Fee', 'MODULE_SHIPPING_EMS_HANDLING_" . $i."', '0', 'Handling Fee for this shipping zone', '6', '0', now())");
    
          }
    
        }
    
    
    
        function remove() {
    
          global $db;
    
          $db->Execute("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
    
        }
    
    
    
        function keys() {
    
          $keys = array('MODULE_SHIPPING_EMS_STATUS', 'MODULE_SHIPPING_EMS_METHOD', 'MODULE_SHIPPING_EMS_TAX_CLASS', 'MODULE_SHIPPING_EMS_TAX_BASIS', 'MODULE_SHIPPING_EMS_SORT_ORDER', 'MODULE_SHIPPING_EMS_SKIPPED');
    
    
    
          for ($i=1; $i<=$this->num_zones; $i++) {
    
            $keys[] = 'MODULE_SHIPPING_EMS_COUNTRIES_' . $i;
    
            $keys[] = 'MODULE_SHIPPING_EMS_COST_' . $i;
    
            $keys[] = 'MODULE_SHIPPING_EMS_HANDLING_' . $i;
    
          }
    
    
    
          return $keys;
    
        }
    
      }
    If I delete the EMS.php file, the EMS shipping module doesn't display under Admin > Modules > Shipping

    Thanks for your attention
    I just installed this and it works fine ... no errors.
    Granted, I did remove all your double-spacing first.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  8. #8
    Join Date
    Jul 2007
    Location
    Jakarta
    Posts
    358
    Plugin Contributions
    0

    Default Re: Error installing cloned zone shipping module

    I'm running ZenCart 1.3.7.
    I renamed my EMS.php to ems.php and uploaded it. Now I get this error when loading shipping modules from Admin>Modules>Shipping.

    Code:
    Warning:  main(/home/alifina/public_html/boutique/includes/languages/english/modules/shipping/ems.php) [function.main]: failed to open stream: No such file or directory in /home/alifina/public_html/boutique/admin/modules.php on line 174
    
    Warning:  main() [function.include]: Failed opening '/home/alifina/public_html/boutique/includes/languages/english/modules/shipping/ems.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/alifina/public_html/boutique/admin/modules.php on line 174
    Sorry, I just copied and pasted the part of ems.php that I thought was relevant. The spaces in the file are from the original. I didn't ad them.

  9. #9
    Join Date
    Jul 2007
    Location
    Jakarta
    Posts
    358
    Plugin Contributions
    0

    Default Re: Error installing cloned zone shipping module

    I forgot to rename the language/modules/shipping/EMS.php to ems.php
    I think that's the problem.

  10. #10
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Error installing cloned zone shipping module

    Let us know if you get this working with the filename written correctly ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v151 Cloned table shipping module not showing zone selector
    By earmsby in forum Built-in Shipping and Payment Modules
    Replies: 4
    Last Post: 17 Oct 2013, 06:29 PM
  2. Shipping method not showing for cloned flat rate zone
    By wildfashions in forum Built-in Shipping and Payment Modules
    Replies: 4
    Last Post: 27 Apr 2009, 03:41 AM
  3. error with cloned shipping module
    By SailorDraco in forum Built-in Shipping and Payment Modules
    Replies: 9
    Last Post: 25 Sep 2008, 03:56 AM
  4. Cloned shipping module problem
    By psr racing in forum Built-in Shipping and Payment Modules
    Replies: 22
    Last Post: 6 Mar 2008, 12:04 PM
  5. Error with cloned flat module
    By earmsby in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 29 Nov 2006, 04:00 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR