Example #1
0
 function sagawaex()
 {
     global $order, $db;
     $this->code = 'sagawaex';
     $this->title = MODULE_SHIPPING_SAGAWAEX_TEXT_TITLE;
     $this->description = MODULE_SHIPPING_SAGAWAEX_TEXT_DESCRIPTION;
     $this->sort_order = MODULE_SHIPPING_SAGAWAEX_SORT_ORDER;
     //      $this->icon        = DIR_WS_ICONS . 'shipping_sagawaex.gif';
     $this->tax_class = in_array('MODULE_SHIPPING_SAGAWAEX_TAX_CLASS', $this->keys()) ? MODULE_SHIPPING_SAGAWAEX_TAX_CLASS : 0;
     if (zen_get_shipping_enabled($this->code)) {
         $this->enabled = MODULE_SHIPPING_SAGAWAEX_STATUS == 'True' ? true : false;
     }
     // only these three are needed since SagawaEx only ships to them
     // convert TEP country id to ISO 3166 id
     $this->sagawaex_countries = array(107 => 'JP');
     $this->sagawaex_countries_nbr = array(107);
     if ($this->enabled == true && (int) MODULE_SHIPPING_SAGAWAEX_ZONE > 0) {
         $check_flag = false;
         $check = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_SAGAWAEX_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
         while (!$check->EOF) {
             if ($check->fields['zone_id'] < 1) {
                 $check_flag = true;
                 break;
             } elseif ($check->fields['zone_id'] == $order->delivery['zone_id']) {
                 $check_flag = true;
                 break;
             }
             $check->MoveNext();
         }
         if ($check_flag == false) {
             $this->enabled = false;
         }
     }
 }
Example #2
0
 function mzmt()
 {
     global $order;
     $this->code = 'mzmt';
     $this->title = MODULE_SHIPPING_MZMT_TEXT_TITLE;
     $this->description = MODULE_SHIPPING_MZMT_TEXT_DESCRIPTION;
     $this->sort_order = MODULE_SHIPPING_MZMT_SORT_ORDER;
     $this->tax_class = MODULE_SHIPPING_MZMT_TAX_CLASS;
     $this->tax_basis = MODULE_SHIPPING_MZMT_TAX_BASIS;
     $this->num_geozones = MODULE_SHIPPING_MZMT_NUMBER_GEOZONES;
     $this->num_tables = MODULE_SHIPPING_MZMT_NUMBER_TABLES;
     // disable only when entire cart is free shipping
     if (zen_get_shipping_enabled($this->code)) {
         $this->enabled = MODULE_SHIPPING_MZMT_STATUS == 'True' ? true : false;
     }
     if ($this->enabled == true) {
         $this->enabled = false;
         for ($n = 1; $n <= $this->num_geozones; $n++) {
             if ((int) constant('MODULE_SHIPPING_MZMT_GEOZONE_' . $n . '_ID') > 0 && (int) constant('MODULE_SHIPPING_MZMT_GEOZONE_' . $n . '_ID') == $this->getGeoZoneID($order->delivery['country']['id'], $order->delivery['zone_id'])) {
                 $this->enabled = true;
                 $this->delivery_geozone = $n;
                 break;
             } elseif ((int) constant('MODULE_SHIPPING_MZMT_GEOZONE_' . $n . '_ID') == 0 && $n == (int) $this->num_geozones) {
                 $this->enabled = true;
                 $this->delivery_geozone = $n;
                 break;
             }
         }
     }
 }
Example #3
0
 function ems()
 {
     global $order;
     $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;
     }
     //##################BOF:limit for delivery to only those countries like DE######
     //added by john 2010-06-21
     $dest_country = $order->delivery['country']['iso_code_2'];
     if (!defined('MODULE_SHIPPING_EMS_DISABLED_COUNTRIES')) {
         $this->enabled = false;
     }
     if ($this->enabled == true && defined('MODULE_SHIPPING_EMS_DISABLED_COUNTRIES')) {
         $disabled2countries = split("[,]", constant('MODULE_SHIPPING_EMS_DISABLED_COUNTRIES'));
         if (is_array($disabled2countries) && in_array($dest_country, $disabled2countries)) {
             $this->enabled = false;
         } else {
             $this->enabled = true;
         }
     }
     //##################EOF:limit for delivery to only those countries like DE######
 }
Example #4
0
 /**
  * Constructor
  *
  * @return usps
  */
 function usps()
 {
     global $order, $db, $template;
     $this->code = 'usps';
     $this->title = MODULE_SHIPPING_USPS_TEXT_TITLE;
     $this->description = MODULE_SHIPPING_USPS_TEXT_DESCRIPTION;
     $this->sort_order = MODULE_SHIPPING_USPS_SORT_ORDER;
     $this->icon = $template->get_template_dir('shipping_usps.gif', DIR_WS_TEMPLATE, $current_page_base, 'images/icons') . '/' . 'shipping_usps.gif';
     $this->tax_class = MODULE_SHIPPING_USPS_TAX_CLASS;
     $this->tax_basis = MODULE_SHIPPING_USPS_TAX_BASIS;
     // disable only when entire cart is free shipping
     if (zen_get_shipping_enabled($this->code)) {
         $this->enabled = MODULE_SHIPPING_USPS_STATUS == 'True' ? true : false;
     }
     if ($this->enabled == true && (int) MODULE_SHIPPING_USPS_ZONE > 0) {
         $check_flag = false;
         $check = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_USPS_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
         while (!$check->EOF) {
             if ($check->fields['zone_id'] < 1) {
                 $check_flag = true;
                 break;
             } elseif ($check->fields['zone_id'] == $order->delivery['zone_id']) {
                 $check_flag = true;
                 break;
             }
             $check->MoveNext();
         }
         if ($check_flag == false) {
             $this->enabled = false;
         }
     }
     $this->types = array('Express' => 'Express Mail', 'First Class' => 'First-Class Mail', 'Priority' => 'Priority Mail', 'Parcel' => 'Parcel Post', 'Media' => 'Media Mail', 'BPM' => 'Bound Printed Material', 'Library' => 'Library');
     $this->intl_types = array('GXG Document' => 'Global Express Guaranteed Document Service', 'GXG Non-Document' => 'Global Express Guaranteed Non-Document Service', 'Express' => 'Global Express Mail (EMS)', 'Priority Lg' => 'Global Priority Mail - Flat-rate Envelope (Large)', 'Priority Sm' => 'Global Priority Mail - Flat-rate Envelope (Small)', 'Priority Var' => 'Global Priority Mail - Variable Weight (Single)', 'Airmail Letter' => 'Airmail Letter Post', 'Airmail Parcel' => 'Airmail Parcel Post', 'Surface Letter' => 'Economy (Surface) Letter Post', 'Surface Post' => 'Economy (Surface) Parcel Post');
     $this->countries = $this->country_list();
 }
Example #5
0
 /**
  * Constructor
  *
  * @return ups
  */
 function ups()
 {
     global $order, $db, $template;
     $this->code = 'ups';
     $this->title = MODULE_SHIPPING_UPS_TEXT_TITLE;
     $this->description = MODULE_SHIPPING_UPS_TEXT_DESCRIPTION;
     $this->sort_order = MODULE_SHIPPING_UPS_SORT_ORDER;
     $this->icon = $template->get_template_dir('shipping_ups.gif', DIR_WS_TEMPLATE, $current_page_base, 'images/icons') . '/' . 'shipping_ups.gif';
     $this->tax_class = MODULE_SHIPPING_UPS_TAX_CLASS;
     $this->tax_basis = MODULE_SHIPPING_UPS_TAX_BASIS;
     // disable only when entire cart is free shipping
     if (zen_get_shipping_enabled($this->code)) {
         $this->enabled = MODULE_SHIPPING_UPS_STATUS == 'True' ? true : false;
     }
     if ($this->enabled == true && (int) MODULE_SHIPPING_UPS_ZONE > 0) {
         $check_flag = false;
         $check = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_UPS_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
         while (!$check->EOF) {
             if ($check->fields['zone_id'] < 1) {
                 $check_flag = true;
                 break;
             } elseif ($check->fields['zone_id'] == $order->delivery['zone_id']) {
                 $check_flag = true;
                 break;
             }
             $check->MoveNext();
         }
         if ($check_flag == false) {
             $this->enabled = false;
         }
     }
     $this->types = array('1DM' => 'Next Day Air Early AM', '1DML' => 'Next Day Air Early AM Letter', '1DA' => 'Next Day Air', '1DAL' => 'Next Day Air Letter', '1DAPI' => 'Next Day Air Intra (Puerto Rico)', '1DP' => 'Next Day Air Saver', '1DPL' => 'Next Day Air Saver Letter', '2DM' => '2nd Day Air AM', '2DML' => '2nd Day Air AM Letter', '2DA' => '2nd Day Air', '2DAL' => '2nd Day Air Letter', '3DS' => '3 Day Select', 'GND' => 'Ground', 'GNDCOM' => 'Ground Commercial', 'GNDRES' => 'Ground Residential', 'STD' => 'Canada Standard', 'XPR' => 'Worldwide Express', 'XPRL' => 'worldwide Express Letter', 'XDM' => 'Worldwide Express Plus', 'XDML' => 'Worldwide Express Plus Letter', 'XPD' => 'Worldwide Expedited', 'WXS' => 'Worldwide Saver');
 }
Example #6
0
 /**
  * Constructor
  *
  * @return usps
  */
 function usps()
 {
     global $order, $db, $template;
     $this->code = 'usps';
     $this->title = MODULE_SHIPPING_USPS_TEXT_TITLE;
     $this->description = MODULE_SHIPPING_USPS_TEXT_DESCRIPTION;
     $this->sort_order = MODULE_SHIPPING_USPS_SORT_ORDER;
     $this->icon = $template->get_template_dir('shipping_usps.gif', DIR_WS_TEMPLATE, $current_page_base, 'images/icons') . '/' . 'shipping_usps.gif';
     $this->tax_class = MODULE_SHIPPING_USPS_TAX_CLASS;
     $this->tax_basis = MODULE_SHIPPING_USPS_TAX_BASIS;
     // disable only when entire cart is free shipping
     if (zen_get_shipping_enabled($this->code)) {
         $this->enabled = MODULE_SHIPPING_USPS_STATUS == 'True' ? true : false;
     }
     if ($this->enabled == true && (int) MODULE_SHIPPING_USPS_ZONE > 0) {
         $check_flag = false;
         $check = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_USPS_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
         while (!$check->EOF) {
             if ($check->fields['zone_id'] < 1) {
                 $check_flag = true;
                 break;
             } elseif ($check->fields['zone_id'] == $order->delivery['zone_id']) {
                 $check_flag = true;
                 break;
             }
             $check->MoveNext();
         }
         if ($check_flag == false) {
             $this->enabled = false;
         }
     }
     $this->types = array('EXPRESS' => 'Express Mail', 'FIRST CLASS' => 'First-Class Mail', 'PRIORITY' => 'Priority Mail', 'PARCEL' => 'Parcel Post', 'MEDIA' => 'Media Mail', 'BPM' => 'Bound Printed Material', 'LIBRARY' => 'Library');
     $this->intl_types = array('Global Express' => 'Global Express Guaranteed', 'Global Express Non-Doc Rect' => 'Global Express Guaranteed Non-Document Rectangular', 'Global Express Non-Doc Non-Rect' => 'Global Express Guaranteed Non-Document Non-Rectangular', 'Express Mail Int' => 'Express Mail International (EMS)', 'Express Mail Int Flat Rate Env' => 'Express Mail International (EMS) Flat Rate Envelope', 'Priority Mail International' => 'Priority Mail International', 'Priority Mail Int Flat Rate Env' => 'Priority Mail International Flat Rate Envelope', 'Priority Mail Int Flat Rate Box' => 'Priority Mail International Flat Rate Box', 'First-Class Mail Int' => 'First-Class Mail International');
     $this->countries = $this->country_list();
 }
Example #7
0
 /**
  * Constructor
  *
  * @return usps
  */
 function canadapost()
 {
     global $order, $gBitDb, $template, $gBitLanguage;
     $this->code = 'canadapost';
     $this->title = tra('Canada Post');
     $this->description = tra('Canada Post Parcel Service<p><strong>CPC Profile Information </strong>can be obtained at http://sellonline.canadapost.ca<br /><a href=http://sellonline.canadapost.ca/servlet/LogonServlet?Language=0 target="_blank">Modify my profile</a>');
     $this->icon = 'shipping_canadapost';
     $this->enabled = zen_get_shipping_enabled($this->code) && CommerceSystem::isConfigActive('MODULE_SHIPPING_CANADAPOST_STATUS');
     if ($this->enabled == true) {
         $this->server = MODULE_SHIPPING_CANADAPOST_SERVERIP;
         $this->port = MODULE_SHIPPING_CANADAPOST_SERVERPOST;
         $this->language = in_array($gBitLanguage->getLanguage(), array('en', 'fr')) ? strtolower($gBitLanguage->getLanguage()) : MODULE_SHIPPING_CANADAPOST_LANGUAGE;
         $this->CPCID = MODULE_SHIPPING_CANADAPOST_CPCID;
         $this->turnaround_time = MODULE_SHIPPING_CANADAPOST_TIME;
         $this->sort_order = MODULE_SHIPPING_CANADAPOST_SORT_ORDER;
         $this->items_qty = 0;
         $this->items_price = 0;
         $this->tax_class = MODULE_SHIPPING_CANADAPOST_TAX_CLASS;
         $this->tax_basis = MODULE_SHIPPING_CANADAPOST_TAX_BASIS;
         $this->cp_online_handling = MODULE_SHIPPING_CANADAPOST_CP_HANDLING == 'True' ? true : false;
         $this->lettermail = MODULE_SHIPPING_CANADAPOST_LETTERMAIL_STATUS == 'True' ? true : false;
         $this->lettermail_max_weight = MODULE_SHIPPING_CANADAPOST_LETTERMAIL_MAX;
         $this->lettermail_available = false;
         if (MODULE_SHIPPING_CANADAPOST_ZONE) {
             $this->enabled = $gBitDb->query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = ?, and zone_country_id = ?", array(MODULE_SHIPPING_CANADAPOST_ZONE, $order->delivery['country']['id']));
         }
     }
 }
 function freeshipper()
 {
     global $order, $db;
     $this->code = 'freeshipper';
     $this->title = MODULE_SHIPPING_FREESHIPPER_TEXT_TITLE;
     $this->description = MODULE_SHIPPING_FREESHIPPER_TEXT_DESCRIPTION;
     $this->sort_order = MODULE_SHIPPING_FREESHIPPER_SORT_ORDER;
     $this->icon = '';
     $this->tax_class = MODULE_SHIPPING_FREESHIPPER_TAX_CLASS;
     // enable only when entire cart is free shipping
     //      if ($_SESSION['cart']->in_cart_check('product_is_always_free_shipping','1') == $_SESSION['cart']->count_contents()) {
     if (zen_get_shipping_enabled($this->code)) {
         $this->enabled = MODULE_SHIPPING_FREESHIPPER_STATUS == 'True' ? true : false;
     }
     if ($this->enabled == true && (int) MODULE_SHIPPING_FREESHIPPER_ZONE > 0) {
         $check_flag = false;
         $check = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_FREESHIPPER_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
         while (!$check->EOF) {
             if ($check->fields['zone_id'] < 1) {
                 $check_flag = true;
                 break;
             } elseif ($check->fields['zone_id'] == $order->delivery['zone_id']) {
                 $check_flag = true;
                 break;
             }
             $check->MoveNext();
         }
         if ($check_flag == false) {
             $this->enabled = false;
         }
     }
 }
Example #9
0
 function item()
 {
     global $order, $db;
     $this->code = 'item';
     $this->title = MODULE_SHIPPING_ITEM_TEXT_TITLE;
     $this->description = MODULE_SHIPPING_ITEM_TEXT_DESCRIPTION;
     $this->sort_order = MODULE_SHIPPING_ITEM_SORT_ORDER;
     $this->icon = '';
     $this->tax_class = MODULE_SHIPPING_ITEM_TAX_CLASS;
     $this->tax_basis = MODULE_SHIPPING_ITEM_TAX_BASIS;
     // disable only when entire cart is free shipping
     if (zen_get_shipping_enabled($this->code)) {
         $this->enabled = MODULE_SHIPPING_ITEM_STATUS == 'True' ? true : false;
     }
     if ($this->enabled == true && (int) MODULE_SHIPPING_ITEM_ZONE > 0) {
         $check_flag = false;
         $check = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_ITEM_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
         while (!$check->EOF) {
             if ($check->fields['zone_id'] < 1) {
                 $check_flag = true;
                 break;
             } elseif ($check->fields['zone_id'] == $order->delivery['zone_id']) {
                 $check_flag = true;
                 break;
             }
             $check->MoveNext();
         }
         if ($check_flag == false) {
             $this->enabled = false;
         }
     }
 }
Example #10
0
 function usps()
 {
     global $order, $db, $template, $current_page_base;
     $this->code = 'usps';
     $this->title = MODULE_SHIPPING_USPS_TEXT_TITLE;
     $this->description = MODULE_SHIPPING_USPS_TEXT_DESCRIPTION;
     $this->sort_order = MODULE_SHIPPING_USPS_SORT_ORDER;
     $this->icon = $template->get_template_dir('shipping_usps.gif', DIR_WS_TEMPLATE, $current_page_base, 'images/icons') . '/' . 'shipping_usps.gif';
     $this->tax_class = MODULE_SHIPPING_USPS_TAX_CLASS;
     $this->tax_basis = MODULE_SHIPPING_USPS_TAX_BASIS;
     // disable only when entire cart is free shipping
     if (zen_get_shipping_enabled($this->code)) {
         $this->enabled = MODULE_SHIPPING_USPS_STATUS == 'True' ? true : false;
     }
     if ($this->enabled) {
         // check MODULE_SHIPPING_USPS_HANDLING_METHOD is in
         $check_query = $db->Execute("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_USPS_HANDLING_METHOD'");
         if ($check_query->EOF) {
             $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Handling Per Order or Per Box', 'MODULE_SHIPPING_USPS_HANDLING_METHOD', 'Box', 'Do you want to charge Handling Fee Per Order or Per Box?', '6', '0', 'zen_cfg_select_option(array(\\'Order\\', \\'Box\\'), ', now())");
         }
     }
     if ($this->enabled == true && (int) MODULE_SHIPPING_USPS_ZONE > 0) {
         $check_flag = false;
         $check = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_USPS_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
         while (!$check->EOF) {
             if ($check->fields['zone_id'] < 1) {
                 $check_flag = true;
                 break;
             } elseif ($check->fields['zone_id'] == $order->delivery['zone_id']) {
                 $check_flag = true;
                 break;
             }
             $check->MoveNext();
         }
         if ($check_flag == false) {
             $this->enabled = false;
         }
     }
     $this->types = array('EXPRESS' => 'Express Mail', 'FIRST CLASS' => 'First-Class Mail', 'PRIORITY' => 'Priority Mail', 'PARCEL' => 'Parcel Post', 'MEDIA' => 'Media Mail', 'BPM' => 'Bound Printed Matter', 'LIBRARY' => 'Library');
     $this->intl_types = array('Global Express' => 'Global Express Guaranteed (GXG)', 'Global Express Non-Doc Rect' => 'Global Express Guaranteed Non-Document Rectangular', 'Global Express Non-Doc Non-Rect' => 'Global Express Guaranteed Non-Document Non-Rectangular', 'Global Express Envelopes' => 'USPS GXG Envelopes', 'Express Mail Int' => 'Express Mail International', 'Express Mail Int Flat Rate Env' => 'Express Mail International Flat Rate Envelope', 'Priority Mail International' => 'Priority Mail International', 'Priority Mail Int Flat Rate Env' => 'Priority Mail International Flat Rate Envelope', 'Priority Mail Int Flat Rate Box' => 'Priority Mail International Flat Rate Box', 'Priority Mail Int Flat Rate Small Box' => 'Priority Mail International Small Flat Rate Box', 'Priority Mail Int Flat Rate Med Box' => 'Priority Mail International Medium Flat Rate Box', 'Priority Mail Int Flat Rate Lrg Box' => 'Priority Mail International Large Flat Rate Box', 'First Class Mail Int Lrg Env' => 'First-Class Mail International Large Envelope', 'First Class Mail Int Package' => 'First-Class Mail International Package', 'First Class Mail Int Letter' => 'First-Class Mail International Letter');
     $this->countries = $this->country_list();
     // use USPS translations for US shops
     $this->usps_countries = $this->usps_translation();
 }
Example #11
0
 function zasilkovna()
 {
     global $order, $db;
     /** injected code cleanup (for mailing, etc) **/
     if (preg_match('/^Zásilkovna/', $order->info['shipping_method'])) {
         $order->info['shipping_method'] = MODULE_SHIPPING_ZAS_TEXT_WAY;
     }
     if (preg_match('/^Zásilkovna/', $_SESSION['shipping']['title'])) {
         $_SESSION['shipping']['title'] = MODULE_SHIPPING_ZAS_TEXT_WAY;
     }
     $this->code = 'zasilkovna';
     $this->title = MODULE_SHIPPING_ZAS_TEXT_TITLE;
     $this->description = MODULE_SHIPPING_ZAS_TEXT_DESCRIPTION;
     $this->sort_order = MODULE_SHIPPING_ZAS_SORT_ORDER;
     $this->api_key = MODULE_SHIPPING_ZAS_API_KEY;
     $this->country = MODULE_SHIPPING_ZAS_COUNTRY == 'Vše' ? '' : (MODULE_SHIPPING_ZAS_COUNTRY == 'Slovenská republika' ? 'sk' : 'cz');
     $this->icon = '';
     $this->tax_class = MODULE_SHIPPING_ZAS_TAX_CLASS;
     $this->tax_basis = MODULE_SHIPPING_ZAS_TAX_BASIS == 'Doprava' ? 'Shipping' : (MODULE_SHIPPING_ZAS_TAX_BASIS == 'Fakturace' ? 'Billing' : 'Store');
     // disable only when entire cart is free shipping
     if (zen_get_shipping_enabled($this->code)) {
         $this->enabled = MODULE_SHIPPING_ZAS_STATUS == 'Povolit' && $this->api_key ? true : false;
     }
     if ($this->enabled == true && (int) MODULE_SHIPPING_ZAS_ZONE > 0) {
         $check_flag = false;
         $check = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_ZAS_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
         while (!$check->EOF) {
             if ($check->fields['zone_id'] < 1) {
                 $check_flag = true;
                 break;
             } elseif ($check->fields['zone_id'] == $order->delivery['zone_id']) {
                 $check_flag = true;
                 break;
             }
             $check->MoveNext();
         }
         if ($check_flag == false) {
             $this->enabled = false;
         }
     }
     if ($order->info['shipping_module_code'] == 'zasilkovna_' . $this->code) {
         $order->info['shipping_method'] = $this->title . ' (' . $this->description . ')';
     }
 }
Example #12
0
 function __construct()
 {
     global $order, $customer_id;
     parent::__construct();
     @define('MODULE_SHIPPING_FEDEX_WEB_SERVICES_INSURE', 0);
     $this->code = "fedexwebservices";
     $this->title = tra('FedEx');
     $this->description = 'You will need to have registered an account with FedEx and proper approval from FedEx identity to use this module. Please see the README.TXT file for other requirements.';
     $this->icon = 'shipping_fedex';
     if (MODULE_SHIPPING_FEDEX_WEB_SERVICES_FREE_SHIPPING == 'true' || zen_get_shipping_enabled($this->code)) {
         $this->enabled = MODULE_SHIPPING_FEDEX_WEB_SERVICES_STATUS == 'true' ? true : false;
     }
     if (defined("SHIPPING_ORIGIN_COUNTRY")) {
         if ((int) SHIPPING_ORIGIN_COUNTRY > 0) {
             $countries_array = zen_get_countries(SHIPPING_ORIGIN_COUNTRY, true);
             $this->country = $countries_array['countries_iso_code_2'];
         } else {
             $this->country = SHIPPING_ORIGIN_COUNTRY;
         }
     } else {
         $this->country = STORE_ORIGIN_COUNTRY;
     }
     if ($this->enabled == true && (int) MODULE_SHIPPING_FEDEX_WEB_SERVICES_ZONE > 0) {
         $this->sort_order = MODULE_SHIPPING_FEDEX_WEB_SERVICES_SORT_ORDER;
         $this->tax_class = MODULE_SHIPPING_FEDEX_WEB_SERVICES_TAX_CLASS;
         $check_flag = false;
         $check = $this->mDb->query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_FEDEX_WEB_SERVICES_ZONE . "' and zone_country_id = '" . $order->delivery['country']['countries_id'] . "' order by zone_id");
         while (!$check->EOF) {
             if ($check->fields['zone_id'] < 1) {
                 $check_flag = true;
                 break;
             } elseif ($check->fields['zone_id'] == $order->delivery['zone_id']) {
                 $check_flag = true;
                 break;
             }
             $check->MoveNext();
         }
         if ($check_flag == false) {
             $this->enabled = false;
         }
     }
 }
Example #13
0
 function zones()
 {
     $this->code = 'zones';
     $this->title = MODULE_SHIPPING_ZONES_TEXT_TITLE;
     $this->description = MODULE_SHIPPING_ZONES_TEXT_DESCRIPTION;
     $this->sort_order = MODULE_SHIPPING_ZONES_SORT_ORDER;
     $this->icon = '';
     $this->tax_class = MODULE_SHIPPING_ZONES_TAX_CLASS;
     $this->tax_basis = MODULE_SHIPPING_ZONES_TAX_BASIS;
     // disable only when entire cart is free shipping
     if (zen_get_shipping_enabled($this->code)) {
         $this->enabled = MODULE_SHIPPING_ZONES_STATUS == 'True' ? true : false;
     }
     // CUSTOMIZE THIS SETTING FOR THE NUMBER OF ZONES NEEDED
     $this->num_zones = 3;
     if (IS_ADMIN_FLAG === true) {
         // build in admin only additional zones if missing in the configuration table due to customization of default $this->num_zones = 3
         global $db;
         for ($i = 1; $i <= $this->num_zones; $i++) {
             $check = $db->Execute("select * from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_ZONES_COUNTRIES_" . $i . "'");
             if ($this->enabled && $check->EOF) {
                 $default_countries = '';
                 $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_ZONES_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_ZONES_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.<br />You can end the last amount as 10000:7% to charge 7% of the Order Total', '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_ZONES_HANDLING_" . $i . "', '0', 'Handling Fee for this shipping zone', '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 ('Handling Per Order or Per Box Zone " . $i . "  (when by weight)' , 'MODULE_SHIPPING_ZONES_HANDLING_METHOD_" . $i . "', 'Order', 'Do you want to charge Handling Fee Per Order or Per Box?', '6', '0', 'zen_cfg_select_option(array(\\'Order\\', \\'Box\\'), ', now())");
             }
         }
     }
     // build in admin only
     if ($this->enabled) {
         global $db;
         for ($i = 1; $i <= $this->num_zones; $i++) {
             // check MODULE_SHIPPING_TABLE_HANDLING_METHOD is in
             $check_query = $db->Execute("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_ZONES_HANDLING_METHOD_" . $i . "'");
             if ($check_query->EOF) {
                 $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Handling Per Order or Per Box Zone " . $i . "  (when by weight)' , 'MODULE_SHIPPING_ZONES_HANDLING_METHOD_" . $i . "', 'Order', 'Do you want to charge Handling Fee Per Order or Per Box?', '6', '0', 'zen_cfg_select_option(array(\\'Order\\', \\'Box\\'), ', now())");
             }
         }
     }
 }
Example #14
0
 /**
  * Constructor
  *
  * @return ups
  */
 function ups()
 {
     global $order, $db, $template, $current_page_base;
     $this->code = 'ups';
     $this->title = MODULE_SHIPPING_UPS_TEXT_TITLE;
     $this->description = MODULE_SHIPPING_UPS_TEXT_DESCRIPTION;
     $this->sort_order = MODULE_SHIPPING_UPS_SORT_ORDER;
     $this->icon = $template->get_template_dir('shipping_ups.gif', DIR_WS_TEMPLATE, $current_page_base, 'images/icons') . '/' . 'shipping_ups.gif';
     $this->tax_class = MODULE_SHIPPING_UPS_TAX_CLASS;
     $this->tax_basis = MODULE_SHIPPING_UPS_TAX_BASIS;
     // disable only when entire cart is free shipping
     if (zen_get_shipping_enabled($this->code)) {
         $this->enabled = MODULE_SHIPPING_UPS_STATUS == 'True' ? true : false;
     }
     if ($this->enabled) {
         // check MODULE_SHIPPING_UPS_HANDLING_METHOD is in
         $check_query = $db->Execute("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_UPS_HANDLING_METHOD'");
         if ($check_query->EOF) {
             $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Handling Per Order or Per Box', 'MODULE_SHIPPING_UPS_HANDLING_METHOD', 'Box', 'Do you want to charge Handling Fee Per Order or Per Box?', '6', '0', 'zen_cfg_select_option(array(\\'Order\\', \\'Box\\'), ', now())");
         }
     }
     if ($this->enabled == true && (int) MODULE_SHIPPING_UPS_ZONE > 0) {
         $check_flag = false;
         $check = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_UPS_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
         while (!$check->EOF) {
             if ($check->fields['zone_id'] < 1) {
                 $check_flag = true;
                 break;
             } elseif ($check->fields['zone_id'] == $order->delivery['zone_id']) {
                 $check_flag = true;
                 break;
             }
             $check->MoveNext();
         }
         if ($check_flag == false) {
             $this->enabled = false;
         }
     }
     $this->types = array('1DM' => 'Next Day Air Early AM', '1DML' => 'Next Day Air Early AM Letter', '1DA' => 'Next Day Air', '1DAL' => 'Next Day Air Letter', '1DAPI' => 'Next Day Air Intra (Puerto Rico)', '1DP' => 'Next Day Air Saver', '1DPL' => 'Next Day Air Saver Letter', '2DM' => '2nd Day Air AM', '2DML' => '2nd Day Air AM Letter', '2DA' => '2nd Day Air', '2DAL' => '2nd Day Air Letter', '3DS' => '3 Day Select', 'GND' => 'Ground', 'GNDCOM' => 'Ground Commercial', 'GNDRES' => 'Ground Residential', 'STD' => 'Canada Standard', 'XPR' => 'Worldwide Express', 'XPRL' => 'Worldwide Express Letter', 'XDM' => 'Worldwide Express Plus', 'XDML' => 'Worldwide Express Plus Letter', 'XPD' => 'Worldwide Expedited', 'WXS' => 'Worldwide Saver');
 }
Example #15
0
 /**
  * Enter description here...
  *
  * @return table
  */
 function table()
 {
     global $order, $db;
     $this->code = 'table';
     $this->title = MODULE_SHIPPING_TABLE_TEXT_TITLE;
     $this->description = MODULE_SHIPPING_TABLE_TEXT_DESCRIPTION;
     $this->sort_order = MODULE_SHIPPING_TABLE_SORT_ORDER;
     $this->icon = '';
     $this->tax_class = MODULE_SHIPPING_TABLE_TAX_CLASS;
     $this->tax_basis = MODULE_SHIPPING_TABLE_TAX_BASIS;
     // disable only when entire cart is free shipping
     if (zen_get_shipping_enabled($this->code)) {
         $this->enabled = MODULE_SHIPPING_TABLE_STATUS == 'True' ? true : false;
     }
     if ($this->enabled) {
         // check MODULE_SHIPPING_TABLE_HANDLING_METHOD is in
         $check_query = $db->Execute("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_TABLE_HANDLING_METHOD'");
         if ($check_query->EOF) {
             $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Handling Per Order or Per Box', 'MODULE_SHIPPING_TABLE_HANDLING_METHOD', 'Order', 'Do you want to charge Handling Fee Per Order or Per Box?', '6', '0', 'zen_cfg_select_option(array(\\'Order\\', \\'Box\\'), ', now())");
         }
     }
     if ($this->enabled == true && (int) MODULE_SHIPPING_TABLE_ZONE > 0) {
         $check_flag = false;
         $check = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_TABLE_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
         while (!$check->EOF) {
             if ($check->fields['zone_id'] < 1) {
                 $check_flag = true;
                 break;
             } elseif ($check->fields['zone_id'] == $order->delivery['zone_id']) {
                 $check_flag = true;
                 break;
             }
             $check->MoveNext();
         }
         if ($check_flag == false) {
             $this->enabled = false;
         }
     }
 }
Example #16
0
 function zones()
 {
     $this->code = 'zones';
     $this->title = MODULE_SHIPPING_ZONES_TEXT_TITLE;
     $this->description = MODULE_SHIPPING_ZONES_TEXT_DESCRIPTION;
     $this->sort_order = MODULE_SHIPPING_ZONES_SORT_ORDER;
     $this->icon = '';
     $this->tax_class = MODULE_SHIPPING_ZONES_TAX_CLASS;
     $this->tax_class = MODULE_SHIPPING_ZONES_TAX_CLASS;
     // disable only when entire cart is free shipping
     if (zen_get_shipping_enabled($this->code)) {
         $this->enabled = MODULE_SHIPPING_ZONES_STATUS == 'True' ? true : false;
     }
     // CUSTOMIZE THIS SETTING FOR THE NUMBER OF ZONES NEEDED
     $this->num_zones = 3;
 }
Example #17
0
 /**
  * check whether this module should be enabled or disabled based on zone assignments and any other rules
  */
 function update_status()
 {
     global $order, $db;
     if (defined('IS_ADMIN_FLAG')) {
         return;
     }
     // disable only when entire cart is free shipping
     if (zen_get_shipping_enabled($this->code) == FALSE) {
         $this->enabled = FALSE;
     }
     if ($this->enabled == true) {
         if ((int) MODULE_SHIPPING_USPS_ZONE > 0) {
             $check_flag = false;
             $check = $this->mDb->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . (int) MODULE_SHIPPING_USPS_ZONE . "' and zone_country_id = '" . (int) $order->delivery['country']['countries_id'] . "' order by zone_id");
             while (!$check->EOF) {
                 if ($check->fields['zone_id'] < 1) {
                     $check_flag = true;
                     break;
                 } elseif ($check->fields['zone_id'] == $order->delivery['zone_id']) {
                     $check_flag = true;
                     break;
                 }
                 $check->MoveNext();
             }
             if ($check_flag == false) {
                 $this->enabled = false;
             }
         }
         global $template, $current_page_base;
         // CUSTOMIZED CONDITIONS GO HERE
         // Optionally add additional code here to change $this->enabled to false based on whatever custom rules you require.
         // -----
         // -----
         // eof: optional additional code
     }
 }