+define('MODULE_SHIPPING_USPS_TEXT_TITLE', 'United States Postal Service');
+define('MODULE_SHIPPING_USPS_TEXT_DESCRIPTION', 'You will need to have registered an account with USPS. Click <a target="_blank" href="https://secure.shippingapis.com/registration/"><strong>HERE</strong></a> for registration details. USPS expects you to use pounds as weight measure for your products.');
+define('MODULE_SHIPPING_USPS_TEXT_ERROR', 'An error occured with the USPS shipping calculations.<br>If you prefer to use USPS as your shipping method, please contact the store owner.');
+define('MODULE_SHIPPING_USPS_STATUS', 'True'); // Do you want to offer USPS shipping?
+define('MODULE_SHIPPING_USPS_SERVER', 'production'); // An account at USPS is needed to use the Production server // production othervise value may be 'test'
+define('MODULE_SHIPPING_USPS_HANDLING', '0'); // Handling fee for this shipping method
+define('MODULE_SHIPPING_USPS_TAX_CLASS', '0'); // Use the following tax class on the shipping fee
+define('MODULE_SHIPPING_USPS_ZONE', '0'); // If a zone is selected, only enable this shipping method for that zone.
+define('MODULE_SHIPPING_USPS_SORT_ORDER', '0'); // Sort order of display.
+define('MODULE_SHIPPING_USPS_TYPES', 'PRIORITY, PARCEL'); // EXPRESS, FIRST CLASS, BMP, MEDIA 'Select the domestic services to be offered:
+define('MODULE_SHIPPING_USPS_TYPES_INTL', 'EXPRESS MAIL INTERNATIONAL (EMS), EXPRESS MAIL INT, EXPRESS MAIL INT FLAT RATE ENV, PRIORITY MAIL INT, PRIORITY MAIL INT FLAT RATE ENV, PRIORITY MAILINT FLAT RATE BOX, FIRST-CLASS MAIL INT');// 'GLOBAL EXPRESS, GLOBAL EXPRESS NON-DOC RECT, GLOBAL EXPRESS NON-DOC NON-RECT, Select the international services to be offered:
+ 'KP' => 'North Korea (Korea, Democratic People\'s Republic of)',
+ 'NO' => 'Norway',
+ 'OM' => 'Oman',
+ 'PK' => 'Pakistan',
+ 'PA' => 'Panama',
+ 'PG' => 'Papua New Guinea',
+ 'PY' => 'Paraguay',
+ 'PE' => 'Peru',
+ 'PH' => 'Philippines',
+ 'PN' => 'Pitcairn Island',
+ 'PL' => 'Poland',
+ 'PT' => 'Portugal',
+ 'QA' => 'Qatar',
+ 'RE' => 'Reunion',
+ 'RO' => 'Romania',
+ 'RU' => 'Russia',
+ 'RW' => 'Rwanda',
+ 'SH' => 'Saint Helena',
+ 'KN' => 'Saint Kitts (St. Christopher and Nevis)',
+ 'LC' => 'Saint Lucia',
+ 'PM' => 'Saint Pierre and Miquelon',
+ 'VC' => 'Saint Vincent and the Grenadines',
+ 'SM' => 'San Marino',
+ 'ST' => 'Sao Tome and Principe',
+ 'SA' => 'Saudi Arabia',
+ 'SN' => 'Senegal',
+ 'YU' => 'Serbia-Montenegro',
+ 'SC' => 'Seychelles',
+ 'SL' => 'Sierra Leone',
+ 'SG' => 'Singapore',
+ 'SK' => 'Slovak Republic',
+ 'SI' => 'Slovenia',
+ 'SB' => 'Solomon Islands',
+ 'SO' => 'Somalia',
+ 'ZA' => 'South Africa',
+ 'GS' => 'South Georgia (Falkland Islands)',
+ 'KR' => 'South Korea (Korea, Republic of)',
+ 'ES' => 'Spain',
+ 'LK' => 'Sri Lanka',
+ 'SD' => 'Sudan',
+ 'SR' => 'Suriname',
+ 'SZ' => 'Swaziland',
+ 'SE' => 'Sweden',
+ 'CH' => 'Switzerland',
+ 'SY' => 'Syrian Arab Republic',
+ 'TW' => 'Taiwan',
+ 'TJ' => 'Tajikistan',
+ 'TZ' => 'Tanzania',
+ 'TH' => 'Thailand',
+ 'TG' => 'Togo',
+ 'TK' => 'Tokelau (Union) Group (Western Samoa)',
+ 'TO' => 'Tonga',
+ 'TT' => 'Trinidad and Tobago',
+ 'TN' => 'Tunisia',
+ 'TR' => 'Turkey',
+ 'TM' => 'Turkmenistan',
+ 'TC' => 'Turks and Caicos Islands',
+ 'TV' => 'Tuvalu',
+ 'UG' => 'Uganda',
+ 'UA' => 'Ukraine',
+ 'AE' => 'United Arab Emirates',
+ 'UY' => 'Uruguay',
+ 'UZ' => 'Uzbekistan',
+ 'VU' => 'Vanuatu',
+ 'VA' => 'Vatican City',
+ 'VE' => 'Venezuela',
+ 'VN' => 'Vietnam',
+ 'WF' => 'Wallis and Futuna Islands',
+ 'WS' => 'Western Samoa',
+ 'YE' => 'Yemen',
+ 'ZM' => 'Zambia',
+ 'ZW' => 'Zimbabwe'
+ );
+
+ $this->countryinsure = array(
+ 'AF' => 0,
+ 'AL' => 0,
+ 'DZ' => 2185,
+ 'AD' => 5000,
+ 'AO' => 0,
+ 'AI' => 415,
+ 'AG' => 60,
+ 'AR' => 5000,
+ 'AM' => 1350,
+ 'AW' => 830,
+ 'AU' => 3370,
+ 'AT' => 5000,
+ 'AZ' => 5000,
+ 'BS' => 2795,
+ 'BH' => 0,
+ 'BD' => 5000,
+ 'BB' => 220,
+ 'BY' => 1323,
+ 'BE' => 5000,
+ 'BZ' => 1600,
+ 'BJ' => 170,
+ 'BM' => 440,
+ 'BT' => 440,
+ 'BO' => 0,
+ 'BA' => 5000,
+ 'BW' => 145,
+ 'BR' => 5000,
+ 'VG' => 165,
+ 'BN' => 4405,
+ 'BG' => 1030,
+ 'BF' => 530,
+ 'MM' => 4045,
+ 'BI' => 790,
+ 'KH' => 0,
+ 'CM' => 5000,
+ 'CA' => 675,
+ 'CV' => 0,
+ 'KY' => 0,
+ 'CF' => 4405,
+ 'TD' => 440,
+ 'CL' => 0,
+ 'CN' => 1130,
+ 'CX' => 3370,
+ 'CC' => 3370,
+ 'CO' => 0,
+ 'KM' => 690,
+ 'CG' => 1685,
+ 'ZR' => 0,
+ 'CK' => 980,
+ 'CR' => 0,
+ 'CI' => 5000,
+ 'HR' => 5000,
+ 'CU' => 0,
+ 'CY' => 5000,
+ 'CZ' => 5000,
+ 'DK' => 5000,
+ 'DJ' => 880,
+ 'DM' => 0,
+ 'DO' => 0,
+ 'TP' => 0,
+ 'EC' => 0,
+ 'EG' => 1685,
+ 'SV' => 0,
+ 'GQ' => 0,
+ 'ER' => 0,
+ 'EE' => 2020,
+ 'ET' => 1000,
+ 'FK' => 510,
+ 'FO' => 5000,
+ 'FJ' => 600,
+ 'FI' => 5000,
+ 'FR' => 5000,
+ 'GF' => 5000,
+ 'PF' => 1015,
+ 'GA' => 485,
+ 'GM' => 2575,
+ 'GE' => 1350,
+ 'DE' => 5000,
+ 'GH' => 5000,
+ 'GI' => 5000,
+ 'GB' => 857,
+ 'GR' => 5000,
+ 'GL' => 5000,
+ 'GD' => 350,
+ 'GP' => 5000,
+ 'GT' => 0,
+ 'GN' => 875,
+ 'GW' => 21,
+ 'GY' => 10,
+ 'HT' => 0,
+ 'HN' => 0,
+ 'HK' => 5000,
+ 'HU' => 5000,
+ 'IS' => 5000,
+ 'IN' => 2265,
+ 'ID' => 0,
+ 'IR' => 0,
+ 'IQ' => 0,
+ 'IE' => 5000,
+ 'IL' => 0,
+ 'IT' => 5000,
+ 'JM' => 0,
+ 'JP' => 5000,
+ 'JO' => 0,
+ 'KZ' => 5000,
+ 'KE' => 815,
+ 'KI' => 0,
+ 'KW' => 1765,
+ 'KG' => 1350,
+ 'LA' => 0,
+ 'LV' => 1350,
+ 'LB' => 440,
+ 'LS' => 440,
+ 'LR' => 440,
+ 'LY' => 0,
+ 'LI' => 5000,
+ 'LT' => 5000,
+ 'LU' => 5000,
+ 'MO' => 4262,
+ 'MK' => 2200,
+ 'MG' => 675,
+ 'MW' => 50,
+ 'MY' => 1320,
+ 'MV' => 0,
+ 'ML' => 950,
+ 'MT' => 5000,
+ 'MQ' => 5000,
+ 'MR' => 635,
+ 'MU' => 270,
+ 'YT' => 5000,
+ 'MX' => 0,
+ 'MD' => 1350,
+ 'MC' => 5000,
+ 'MN' => 440,
+ 'MS' => 2200,
+ 'MA' => 5000,
+ 'MZ' => 0,
+ 'NA' => 4405,
+ 'NR' => 220,
+ 'NP' => 0,
+ 'NL' => 5000,
+ 'AN' => 830,
+ 'NC' => 1615,
+ 'NZ' => 980,
+ 'NI' => 440,
+ 'NE' => 810,
+ 'NG' => 205,
+ 'KP' => 0,
+ 'NO' => 0,
+ 'OM' => 575,
+ 'PK' => 270,
+ 'PA' => 0,
+ 'PG' => 445,
+ 'PY' => 0,
+ 'PE' => 0,
+ 'PH' => 270,
+ 'PN' => 0,
+ 'PL' => 1350,
+ 'PT' => 5000,
+ 'QA' => 2515,
+ 'RE' => 5000,
+ 'RO' => 5000,
+ 'RU' => 5000,
+ 'RW' => 0,
+ 'SH' => 170,
+ 'KN' => 210,
+ 'LC' => 400,
+ 'PM' => 5000,
+ 'VC' => 130,
+ 'SM' => 5000,
+ 'ST' => 440,
+ 'SA' => 0,
+ 'SN' => 865,
+ 'YU' => 5000,
+ 'SC' => 0,
+ 'SL' => 0,
+ 'SG' => 4580,
+ 'SK' => 5000,
+ 'SI' => 4400,
+ 'SB' => 0,
+ 'SO' => 440,
+ 'ZA' => 1760,
+ 'GS' => 510,
+ 'KR' => 5000,
+ 'ES' => 5000,
+ 'LK' => 35,
+ 'SD' => 0,
+ 'SR' => 535,
+ 'SZ' => 560,
+ 'SE' => 5000,
+ 'CH' => 5000,
+ 'SY' => 3080,
+ 'TW' => 1350,
+ 'TJ' => 1350,
+ 'TZ' => 230,
+ 'TH' => 1350,
+ 'TG' => 2190,
+ 'TK' => 295,
+ 'TO' => 515,
+ 'TT' => 930,
+ 'TN' => 2200,
+ 'TR' => 880,
+ 'TM' => 675,
+ 'TC' => 0,
+ 'TV' => 4715,
+ 'UG' => 0,
+ 'UA' => 5000,
+ 'AE' => 5000,
+ 'UY' => 0,
+ 'UZ' => 5000,
+ 'VU' => 0,
+ 'VA' => 5000,
+ 'VE' => 0,
+ 'VN' => 0,
+ 'WF' => 1615,
+ 'WS' => 295,
+ 'YE' => 0,
+ 'ZM' => 540,
+ 'ZW' => 600,
+ 'US' => 5000
+ );
+ }
+
+ function SetInsurance()
+ {
+ $this->insurance_cost = 0;
+
+ // Insurance module by Kevin Shelton
+ // divide the value of the order among the packages based on the order total or subtotal depending on whether or not you have configured to insure tax
+ // retrieve the maximum allowed insurance for the destination country and if the package value exceeds it then set package value to the maximum allowed