Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

creepo

Pioneers
  • Posts

    41
  • Joined

  • Last visited

Posts posted by creepo

  1. Had an order come through that had only the shipping and handling fee, but no fee for the chosen method (Ground). Anyone else had such a thing happen?

     

    I'd like to suggest that we add some logic wherein if the shipping fee = 0 (or null etc), that it throws an error rather than completing. Surprised that wouldn't be in there. Perhaps FedEx servers had a glitch and were functioning, but spitting out blank quotes? odd.

     

    I'm digging in further, but thought I'd throw this out there in case I'm not alone.

     

    J

  2. OK, not sure if this will cause other issues, but in /includes/modules/shipping/fedexwebservices.php, I was able to stop the special character SOAP encoding error by applying utf8 encoding to the street address and city (that's where we were getting the errors). Tested ok.

     

    In case it is useful, here's what I changed around line 160 in mine (which is slightly edited now):

     

     

    $request['RequestedShipment']['Recipient'] = array('Address' => array (

    'StreetLines' => array(utf8_encode($street_address), utf8_encode($street_address2)), // customer street address

    'City' => (utf8_encode($city)), //customer city

  3. Hi all - thanks for the contribution and support. I just wanted to raise a couple of remaining issues that we are having.

     

    1) We did experience a $0.00 shipping incident to Canada. We were using List rates. I found someone else's solution was basically to NOT use List Rates or to shut off all ground options to Canada. I'm not sure if that denial of Canada ground options has been incorporated into the newest version, but I am hoping someone can figure out why List rates occasionally fail for Canada - basically defaulting to free shipping. It's a big issue for my client, but we have no options at this point. What we have done is to use Account rates, but I programmed in the ability to adjust % increase cost per service. The % increases in handling fees are applied to groups of services - not a fine enough control for my client - and we were trying to emulate the same rates as the previous module, so I found it much easier to make calculated increased per service hardcoded in the code.

     

    2) Additionally, we had a customer with a SOAP error regarding the handling / use of special characters.

     

    Fatal error: Uncaught SoapFault exception: [Client] SOAP-ERROR: Encoding: string 'M\xe9...' is not a valid utf-8 string in /includes/modules/shipping/fedexwebservices.php:268

     

    I guess I will try to strip / convert special characters that are offensive in the module, class etc. Has anyone else slayed this one?

     

    Thanks!

     

    Jim

  4. Same here. production.shippingapis.com is down. Since about 1:40 CST. Haven't been able to find anyone else talking about it. Anyone? Echo?

     

    I'm turning off USPS for now. Argh.

     

    J

     

    hi just started to have this error tonight after doing some test checkouts that were working....

     

    when i click to checkout, the page just loads then refreshes with no pricing for shipping. at the top of the checkout_shipping.php page it shows:

     

    Warning: fsockopen() [function.fsockopen]: unable to connect to production.shippingapis.com:80 (Connection timed out) in /home/SITE/public_html/includes/classes/http_client.php on line 330

     

    and it says

     

    Shipping Method

    This is currently the only shipping method available to use on this order.

     

     

     

    but nothing is there....is the usps server down for maintenance or something? does this happen often? thanks

  5. OK, I have domestic working well, and international 'tamed' a bit - finally got the descriptions cleaned up thanks to tips here, but in the version of usps.php that we are using, the services are not controlled in the admin, but rather they are/were controlled by commenting out elements in an array. Example, if I didn't want customers to see Priority Mail for domestic, I'd comment it out:

     

    // 'PRIORITY' => 'Priority Mail'),

     

    That also used to work for international types via the array "intl_types". But even if i comment that out, ALL options are displaying for international now... so, well, i hacked this to limit the options. (basically it uses the $skip_array elements to identify keywords in services you don't want to show up to the customer).

     

    $size = sizeof($services);
    for ($i=0, $n=$size; $i<$n; $i++) {
    $skipit = 0;
    if (strpos($services[$i], '<Postage>')) {
    	$service = ereg('<SvcDescription>(.*)</SvcDescription>', $services[$i], $regs);
    	$service = $regs[1];
    
    	$skip_array = array('Rectangular','Envelope','Flat Rate','Legal','GXG');
    
    	foreach ($skip_array as $value) {
    		if (strstr($service, $value)) {
    			$skipit=1;
    		} 
    	}
    
    	$service = str_replace('&lt;sup&gt;&amp;reg;&lt;/sup&gt;', '', $service);
    	$service = str_replace('&lt;sup&gt;&amp;trade;&lt;/sup&gt;', '', $service);
    
    	$postage = ereg('<Postage>(.*)</Postage>', $services[$i], $regs);
    	$postage = $regs[1];
    
    	if (isset($this->service) && ($service != $this->service) ) {
    		continue;
    	}
    
    	if ($skipit !== 1) {
    		$rates[] = array($service => $postage);
    	}
    
    }
    }
    

     

    It's still a band-aid until someone revamps the contribution, but it got us up and running...

     

    Thanks all!

     

    Jim

  6. Thanks so much for posting these files - i have applied and now domestic is back in business - international is still crunked as you stated - but that is less critical for most of my clients. THANKS for sharing!!! You are the man! (no offense if you are wo-man, it's a saying).

     

    J

     

    Sorry I posted the wrong files. I have it working for US on two sites Sorry I haven't gotten International to work

     

    includes/modules/shipping

     

    <?php

    /*

    $Id: usps.php 1783 2008-01-10 01:16:16Z hpdl $

     

    osCommerce, Open Source E-Commerce Solutions

    http://www.oscommerce.com

     

    Copyright © 2008 osCommerce

     

    Released under the GNU General Public License

    */

     

    class usps {

    var $code, $title, $description, $icon, $enabled, $countries;

     

    // class constructor

    function usps() {

    global $order;

     

    $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 = DIR_WS_ICONS . 'shipping_usps.gif';

    $this->tax_class = MODULE_SHIPPING_USPS_TAX_CLASS;

    $this->enabled = ((MODULE_SHIPPING_USPS_STATUS == 'True') ? true : false);

     

    if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_USPS_ZONE > 0) ) {

    $check_flag = false;

    $check_query = tep_db_query("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 = tep_db_fetch_array($check_query)) {

    if ($check['zone_id'] < 1) {

    $check_flag = true;

    break;

    } elseif ($check['zone_id'] == $order->delivery['zone_id']) {

    $check_flag = true;

    break;

    }

    }

     

    if ($check_flag == false) {

    $this->enabled = false;

    }

    }

     

    $this->types = array('EXPRESS' => 'Express Mail',

    'FIRST CLASS' => 'First-Class Mail',

    'PRIORITY' => 'Priority Mail',

    'PARCEL' => 'Parcel Post');

     

    $this->intl_types = array('Global Express Guaranteed',

    'Global Express Guaranteed Non-Document Rectangular',

    'Global Express Guaranteed Non-Document Non-Rectangular',

    'Express Mail International (EMS)',

    'Express Mail International (EMS) Flat Rate Envelope',

    'Priority Mail International',

    'Priority Mail International Flat Rate Envelope',

    'Priority Mail International Flat Rate Box',

    'First-Class Mail International');

     

    $this->countries = $this->country_list();

    }

     

    // class methods

    function quote($method = '') {

    global $order, $shipping_weight, $shipping_num_boxes;

     

    if ( tep_not_null($method) && (isset($this->types[$method]) || in_array($method, $this->intl_types)) ) {

    $this->_setService($method);

    }

     

    $this->_setMachinable('False');

    $this->_setContainer('None');

    $this->_setSize('REGULAR');

     

    // usps doesnt accept zero weight

    $shipping_weight = ($shipping_weight < 0.1 ? 0.1 : $shipping_weight);

    $shipping_pounds = floor ($shipping_weight);

    $shipping_ounces = round(16 * ($shipping_weight - floor($shipping_weight)));

    $this->_setWeight($shipping_pounds, $shipping_ounces);

     

    $uspsQuote = $this->_getQuote();

     

    if (is_array($uspsQuote)) {

    if (isset($uspsQuote['error'])) {

    $this->quotes = array('module' => $this->title,

    'error' => $uspsQuote['error']);

    } else {

    $this->quotes = array('id' => $this->code,

    'module' => $this->title . ' (' . $shipping_num_boxes . ' x ' . $shipping_weight . 'lbs)');

     

    $methods = array();

    $size = sizeof($uspsQuote);

    for ($i=0; $i<$size; $i++) {

    list($type, $cost) = each($uspsQuote[$i]);

     

    $methods[] = array('id' => $type,

    'title' => ((isset($this->types[$type])) ? $this->types[$type] : $type),

    'cost' => ($cost + MODULE_SHIPPING_USPS_HANDLING) * $shipping_num_boxes);

    }

     

    $this->quotes['methods'] = $methods;

     

    if ($this->tax_class > 0) {

    $this->quotes['tax'] = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);

    }

    }

    } else {

    $this->quotes = array('module' => $this->title,

    'error' => MODULE_SHIPPING_USPS_TEXT_ERROR);

    }

     

    if (tep_not_null($this->icon)) $this->quotes['icon'] = tep_image($this->icon, $this->title);

     

    return $this->quotes;

    }

     

    function check() {

    if (!isset($this->_check)) {

    $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_USPS_STATUS'");

    $this->_check = tep_db_num_rows($check_query);

    }

    return $this->_check;

    }

     

    function install() {

    tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable USPS Shipping', 'MODULE_SHIPPING_USPS_STATUS', 'True', 'Do you want to offer USPS shipping?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");

    tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Enter the USPS User ID', 'MODULE_SHIPPING_USPS_USERID', 'NONE', 'Enter the USPS USERID assigned to you.', '6', '0', now())");

    tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Enter the USPS Password', 'MODULE_SHIPPING_USPS_PASSWORD', 'NONE', 'See USERID, above.', '6', '0', now())");

    tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Handling Fee', 'MODULE_SHIPPING_USPS_HANDLING', '0', 'Handling fee for this shipping method.', '6', '0', now())");

    tep_db_query("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_USPS_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())");

    tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Shipping Zone', 'MODULE_SHIPPING_USPS_ZONE', '0', 'If a zone is selected, only enable this shipping method for that zone.', '6', '0', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");

    tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_SHIPPING_USPS_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())");

    }

     

    function remove() {

    tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");

    }

     

    function keys() {

    return array('MODULE_SHIPPING_USPS_STATUS', 'MODULE_SHIPPING_USPS_USERID', 'MODULE_SHIPPING_USPS_PASSWORD', 'MODULE_SHIPPING_USPS_HANDLING', 'MODULE_SHIPPING_USPS_TAX_CLASS', 'MODULE_SHIPPING_USPS_ZONE', 'MODULE_SHIPPING_USPS_SORT_ORDER');

    }

     

    function _setService($service) {

    $this->service = $service;

    }

     

    function _setWeight($pounds, $ounces=0) {

    $this->pounds = $pounds;

    $this->ounces = $ounces;

    }

     

    function _setContainer($container) {

    $this->container = $container;

    }

     

    function _setSize($size) {

    $this->size = $size;

    }

     

    function _setMachinable($machinable) {

    $this->machinable = $machinable;

    }

     

    function _getQuote() {

    global $order;

     

    if ($order->delivery['country']['id'] == SHIPPING_ORIGIN_COUNTRY) {

    $request = '<RateRequest USERID="' . MODULE_SHIPPING_USPS_USERID . '" PASSWORD="' . MODULE_SHIPPING_USPS_PASSWORD . '">';

    $services_count = 0;

     

    if (isset($this->service)) {

    $this->types = array($this->service => $this->types[$this->service]);

    }

     

    $dest_zip = str_replace(' ', '', $order->delivery['postcode']);

    if ($order->delivery['country']['iso_code_2'] == 'US') $dest_zip = substr($dest_zip, 0, 5);

     

    reset($this->types);

    while (list($key, $value) = each($this->types)) {

    $request .= '<Package ID="' . $services_count . '">' .

    '<Service>' . $key . '</Service>' .

    '<ZipOrigination>' . SHIPPING_ORIGIN_ZIP . '</ZipOrigination>' .

    '<ZipDestination>' . $dest_zip . '</ZipDestination>' .

    '<Pounds>' . $this->pounds . '</Pounds>' .

    '<Ounces>' . $this->ounces . '</Ounces>' .

    '<Container>' . $this->container . '</Container>' .

    '<Size>' . $this->size . '</Size>' .

    '<Machinable>' . $this->machinable . '</Machinable>' .

    '</Package>';

    $services_count++;

    }

    $request .= '</RateRequest>';

     

    $request = 'API=Rate&XML=' . urlencode($request);

    } else {

    $request = '<IntlRateRequest USERID="' . MODULE_SHIPPING_USPS_USERID . '" PASSWORD="' . MODULE_SHIPPING_USPS_PASSWORD . '">' .

    '<Package ID="0">' .

    '<Pounds>' . $this->pounds . '</Pounds>' .

    '<Ounces>' . $this->ounces . '</Ounces>' .

    '<MailType>Package</MailType>' .

    '<Country>' . $this->countries[$order->delivery['country']['iso_code_2']] . '</Country>' .

    '</Package>' .

    '</IntlRateRequest>';

     

    $request = 'API=IntlRate&XML=' . urlencode($request);

    }

     

    $body = '';

     

    if (!class_exists('httpClient')) {

    include('includes/classes/http_client.php');

    }

     

    $http = new httpClient();

    if ($http->Connect('production.shippingapis.com', 80)) {

    $http->addHeader('Host', 'production.shippingapis.com');

    $http->addHeader('User-Agent', 'osCommerce');

    $http->addHeader('Connection', 'Close');

     

    if ($http->Get('/shippingapi.dll?' . $request)) $body = $http->getBody();

     

    $http->Disconnect();

    } else {

    return false;

    }

     

    $response = array();

    while (true) {

    if ($start = strpos($body, '<Package ID=')) {

    $body = substr($body, $start);

    $end = strpos($body, '</Package>');

    $response[] = substr($body, 0, $end+10);

    $body = substr($body, $end+9);

    } else {

    break;

    }

    }

     

    $rates = array();

    if ($order->delivery['country']['id'] == SHIPPING_ORIGIN_COUNTRY) {

    if (sizeof($response) == '1') {

    if (ereg('<Error>', $response[0])) {

    $number = ereg('<Number>(.*)</Number>', $response[0], $regs);

    $number = $regs[1];

    $description = ereg('<Description>(.*)</Description>', $response[0], $regs);

    $description = $regs[1];

     

    return array('error' => $number . ' - ' . $description);

    }

    }

     

    $n = sizeof($response);

    for ($i=0; $i<$n; $i++) {

    if (strpos($response[$i], '<Postage>')) {

    $service = ereg('<Service>(.*)</Service>', $response[$i], $regs);

    $service = $regs[1];

    $postage = ereg('<Postage>(.*)</Postage>', $response[$i], $regs);

    $postage = $regs[1];

     

    $rates[] = array($service => $postage);

    }

    }

    } else {

    if (ereg('<Error>', $response[0])) {

    $number = ereg('<Number>(.*)</Number>', $response[0], $regs);

    $number = $regs[1];

    $description = ereg('<Description>(.*)</Description>', $response[0], $regs);

    $description = $regs[1];

     

    return array('error' => $number . ' - ' . $description);

    } else {

    $body = $response[0];

    $services = array();

    while (true) {

    if ($start = strpos($body, '<Service ID=')) {

    $body = substr($body, $start);

    $end = strpos($body, '</Service>');

    $services[] = substr($body, 0, $end+10);

    $body = substr($body, $end+9);

    } else {

    break;

    }

    }

     

    $size = sizeof($services);

    for ($i=0, $n=$size; $i<$n; $i++) {

    if (strpos($services[$i], '<Postage>')) {

    $service = ereg('<SvcDescription>(.*)</SvcDescription>', $services[$i], $regs);

    $service = $regs[1];

    $postage = ereg('<Postage>(.*)</Postage>', $services[$i], $regs);

    $postage = $regs[1];

     

    if (isset($this->service) && ($service != $this->service) ) {

    continue;

    }

     

    $rates[] = array($service => $postage);

    }

    }

    }

    }

     

    return ((sizeof($rates) > 0) ? $rates : false);

    }

     

    function country_list() {

    $list = array('AF' => 'Afghanistan',

    'AL' => 'Albania',

    'DZ' => 'Algeria',

    'AD' => 'Andorra',

    'AO' => 'Angola',

    'AI' => 'Anguilla',

    'AG' => 'Antigua and Barbuda',

    'AR' => 'Argentina',

    'AM' => 'Armenia',

    'AW' => 'Aruba',

    'AU' => 'Australia',

    'AT' => 'Austria',

    'AZ' => 'Azerbaijan',

    'BS' => 'Bahamas',

    'BH' => 'Bahrain',

    'BD' => 'Bangladesh',

    'BB' => 'Barbados',

    'BY' => 'Belarus',

    'BE' => 'Belgium',

    'BZ' => 'Belize',

    'BJ' => 'Benin',

    'BM' => 'Bermuda',

    'BT' => 'Bhutan',

    'BO' => 'Bolivia',

    'BA' => 'Bosnia-Herzegovina',

    'BW' => 'Botswana',

    'BR' => 'Brazil',

    'VG' => 'British Virgin Islands',

    'BN' => 'Brunei Darussalam',

    'BG' => 'Bulgaria',

    'BF' => 'Burkina Faso',

    'MM' => 'Burma',

    'BI' => 'Burundi',

    'KH' => 'Cambodia',

    'CM' => 'Cameroon',

    'CA' => 'Canada',

    'CV' => 'Cape Verde',

    'KY' => 'Cayman Islands',

    'CF' => 'Central African Republic',

    'TD' => 'Chad',

    'CL' => 'Chile',

    'CN' => 'China',

    'CX' => 'Christmas Island (Australia)',

    'CC' => 'Cocos Island (Australia)',

    'CO' => 'Colombia',

    'KM' => 'Comoros',

    'CG' => 'Congo (Brazzaville),Republic of the',

    'ZR' => 'Congo, Democratic Republic of the',

    'CK' => 'Cook Islands (New Zealand)',

    'CR' => 'Costa Rica',

    'CI' => 'Cote d\'Ivoire (Ivory Coast)',

    'HR' => 'Croatia',

    'CU' => 'Cuba',

    'CY' => 'Cyprus',

    'CZ' => 'Czech Republic',

    'DK' => 'Denmark',

    'DJ' => 'Djibouti',

    'DM' => 'Dominica',

    'DO' => 'Dominican Republic',

    'TP' => 'East Timor (Indonesia)',

    'EC' => 'Ecuador',

    'EG' => 'Egypt',

    'SV' => 'El Salvador',

    'GQ' => 'Equatorial Guinea',

    'ER' => 'Eritrea',

    'EE' => 'Estonia',

    'ET' => 'Ethiopia',

    'FK' => 'Falkland Islands',

    'FO' => 'Faroe Islands',

    'FJ' => 'Fiji',

    'FI' => 'Finland',

    'FR' => 'France',

    'GF' => 'French Guiana',

    'PF' => 'French Polynesia',

    'GA' => 'Gabon',

    'GM' => 'Gambia',

    'GE' => 'Georgia, Republic of',

    'DE' => 'Germany',

    'GH' => 'Ghana',

    'GI' => 'Gibraltar',

    'GB' => 'Great Britain and Northern Ireland',

    'GR' => 'Greece',

    'GL' => 'Greenland',

    'GD' => 'Grenada',

    'GP' => 'Guadeloupe',

    'GT' => 'Guatemala',

    'GN' => 'Guinea',

    'GW' => 'Guinea-Bissau',

    'GY' => 'Guyana',

    'HT' => 'Haiti',

    'HN' => 'Honduras',

    'HK' => 'Hong Kong',

    'HU' => 'Hungary',

    'IS' => 'Iceland',

    'IN' => 'India',

    'ID' => 'Indonesia',

    'IR' => 'Iran',

    'IQ' => 'Iraq',

    'IE' => 'Ireland',

    'IL' => 'Israel',

    'IT' => 'Italy',

    'JM' => 'Jamaica',

    'JP' => 'Japan',

    'JO' => 'Jordan',

    'KZ' => 'Kazakhstan',

    'KE' => 'Kenya',

    'KI' => 'Kiribati',

    'KW' => 'Kuwait',

    'KG' => 'Kyrgyzstan',

    'LA' => 'Laos',

    'LV' => 'Latvia',

    'LB' => 'Lebanon',

    'LS' => 'Lesotho',

    'LR' => 'Liberia',

    'LY' => 'Libya',

    'LI' => 'Liechtenstein',

    'LT' => 'Lithuania',

    'LU' => 'Luxembourg',

    'MO' => 'Macao',

    'MK' => 'Macedonia, Republic of',

    'MG' => 'Madagascar',

    'MW' => 'Malawi',

    'MY' => 'Malaysia',

    'MV' => 'Maldives',

    'ML' => 'Mali',

    'MT' => 'Malta',

    'MQ' => 'Martinique',

    'MR' => 'Mauritania',

    'MU' => 'Mauritius',

    'YT' => 'Mayotte (France)',

    'MX' => 'Mexico',

    'MD' => 'Moldova',

    'MC' => 'Monaco (France)',

    'MN' => 'Mongolia',

    'MS' => 'Montserrat',

    'MA' => 'Morocco',

    'MZ' => 'Mozambique',

    'NA' => 'Namibia',

    'NR' => 'Nauru',

    'NP' => 'Nepal',

    'NL' => 'Netherlands',

    'AN' => 'Netherlands Antilles',

    'NC' => 'New Caledonia',

    'NZ' => 'New Zealand',

    'NI' => 'Nicaragua',

    'NE' => 'Niger',

    'NG' => 'Nigeria',

    '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');

     

    return $list;

    }

    }

    ?>

     

    /includes/languages/english/modules/

     

    <?php

    /*

    $Id: usps.php 1739 2007-12-20 00:52:16Z hpdl $

     

    osCommerce, Open Source E-Commerce Solutions

    http://www.oscommerce.com

     

    Copyright © 2002 osCommerce

     

    Released under the GNU General Public License

    */

     

    define('MODULE_SHIPPING_USPS_TEXT_TITLE', 'United States Postal Service');

    define('MODULE_SHIPPING_USPS_TEXT_DESCRIPTION', 'United States Postal Service<br><br>You will need to have registered an account with USPS at http://www.uspsprioritymail.com/et_regcert.html to use this module<br><br>USPS expects you to use pounds as weight measure for your products.');

    define('MODULE_SHIPPING_USPS_TEXT_OPT_PP', 'Parcel Post');

    define('MODULE_SHIPPING_USPS_TEXT_OPT_PM', 'Priority Mail');

    define('MODULE_SHIPPING_USPS_TEXT_OPT_EX', 'Express Mail');

    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.');

    ?>

  7. Thank you so much for sharing this. I have taken it and reworked it a bit to work as a standalone script that can be run by cron. I think this would have worked fine in older OSCommerce with htaccess only on the admin area, but in the newer versions and CRE Loaded, there is an additional admin login, so I was trying to use lynx to pass both htaccess credentials and then also get it to login to the admin area. I gave up on that and stripped all the oscommerce functions out of it so it has no includes, placed it in an admin subdirectory with htaccess only on it and was able to set up a cron job using lynx to get this to run daily (which syncs up nicely with the daily xml quantity updates from the warehouse). Anyways - i wanted to try to share this, but haven't submitted such things before, so I am just going to drop it here and hope someone finds it useful. I did include some help at the top of the file regarding the variables to fill out and the cron command. Hope someone finds this useful! I have it running on a CRE Loaded 6.4.0 B2B site - Remember, your server must support the lynx text browser...

     

    <?php
    /*
     $Id: cron_product_customer_notifications.php
    
     osCommerce, Open Source E-Commerce Solutions
     http://www.oscommerce.com
    
     Copyright (c) 2010 osCommerce
    
     Released under the GNU General Public License
    
     ///////////////////////////////////////////////////
    
     2010-07-20 - jeemdesign.com - stripped out all the oscommerce functions and includes to make this standalone and easier to set with a cron job.  I put mine in my admin dir (which has an additional .htaccess password on it, so it is not open to public).  
    
    
     Here are the lines to edit below:
    
     	$dbhost_osc='localhost';   // your db host
    $dbuser_osc='user_name';   // your db username
    $dbpass_osc='aBc1234#';    // your db password
    $dbase_osc='my_cre_db1';   // your db name
    
    	define('NOTIFICATION_HTTP_SERVER', 'http://www.1234-website-abc.com');  // your http website URL
    	define('DIR_WS_CATALOG', '/');  // your catalog subdirectory if any
    	define('HTTPS_SERVER', 'https://www.1234-website-abc.com');  // your https website URL
    
     	define('STORE_NAME', 'My Store Name');   // Your Store Name
    
    	$from = "From: Customer Service<[email protected]>\r\n";  //  Change to your store's preferred FROM email address
    
    
    Place this (cron_product_customer_notifications.php) in an .htaccess password protected directory, then you can schedule the following command in cron (provided your server has lynx available to you).
    
    Command:
    
    lynx -auth=adminusername:PaSsw0rd123 -dump http://www.1234-website-abc.com/admin/protectedcron/cron_product_customer_notifications.php
    
    * In the command above:
    *  the htaccess credentials are passed via "-auth="  followed by adminusername:PaSsw0rd123
    *  -dump sends the results to standard output, which, if you have the results of the cron job emailed to you, you will get a daily report of product notifications.
    * The last part is the URL to the file.  "protectedcron" is a subfolder in the admin directory.  The admin directory has the .htaccess username and password on it.
    
    
    This is working for me - let me know if you have any trouble with it.  Hope it makes sense and is helpful.  I've taken a lot of stuff from the community and want to give back a bit when possible.  Thanks!  Viva la Open Source!
    
    
    */
    
     $max_mails = 50;  // throttle the # of emails to avoid looking like a spammer
    
    // make db connection
    $dbhost_osc='localhost';   // your db host
    $dbuser_osc='user_name';   // your db username
    $dbpass_osc='aBc1234#';    // your db password
    $dbase_osc='my_cre_db1';   // your db name
    
    $link = mysql_connect($dbhost_osc,$dbuser_osc,$dbpass_osc);
    
    if (!$link) {
    	die('Not Connected to Server: ' . mysql_error());
    }	
    
    //select db
    if(!mysql_select_db($dbase_osc,$link)) {
    	print "no such dbname";
    }
    
    // Automatic Stock Notification
    define('NOTIFICATION_HTTP_SERVER', 'http://www.1234-website-abc.com');  // your http website URL
    define('DIR_WS_CATALOG', '/');  // your catalog subdirectory if any
    define('HTTPS_SERVER', 'https://www.1234-website-abc.com');  // your https website URL
    
    define('TEXT_NOTIFICATION1', 'Dear ');
    define('TEXT_NOTIFICATION2', ',' . "\n\n" . 'According to your ');
    define('TEXT_NOTIFICATION3', ' Product Notifications request, we wish to inform you that ');
    define('TEXT_NOTIFICATION4', ' is now in stock:  ' . NOTIFICATION_HTTP_SERVER . DIR_WS_CATALOG . 'product_info.php?products_id=');
    define('TEXT_NOTIFICATION4b', "\n\n" . 'Please visit ' . NOTIFICATION_HTTP_SERVER . ' if you would like to make a purchase.' . "\n\n" . 'Your product notification for '); 
    define('TEXT_NOTIFICATION5', ' has been removed.  If you would like to receive future stock notifications for ');
    define('TEXT_NOTIFICATION6', ', you must login to your ');
    define('TEXT_NOTIFICATION7', ' account, navigate to the ');
    define('TEXT_NOTIFICATION8', ' page, and click the notifications button.' . "\n\n" . 'Warm greetings from your friends at ');
    
    define('EMAIL_SUBJECT', 'Now In Stock: ');
    
    define('HEADING_TITLE','Generating customer emails for products back in stock');
    define('TABLE_HEADING_STATUS','Status');
    define('TABLE_HEADING_FIRSTNAME','First Name');
    define('TABLE_HEADING_LASTNAME','Last Name');
    define('TABLE_HEADING_CUSTOMERS_ID','Customer Id');
    define('TABLE_HEADING_PRODUCTS_NAME','Products Name');
    define('TABLE_HEADING_PRODUCTS_ID','Products Id');
    define('TABLE_HEADING_EMAIL_ADDRESS','Email Address');
    define('TEXT_NUMBER_OF_EMAILS',' %s out of %s emails sent');
    define('TABLE_PRODUCTS_NOTIFICATIONS', 'products_notifications');
    define('TABLE_CUSTOMERS', 'customers');
    define('TABLE_PRODUCTS', 'products');
    define('TABLE_PRODUCTS_DESCRIPTION', 'products_description');
    
    define('STORE_NAME', 'My Store Name');   // Your Store Name
    
    
    ?>
    <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <title>Automated Stock Notifications</title>
    </head>
    <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
    
    <!-- body //-->
    <table border="0" width="100%" cellspacing="2" cellpadding="2" align="center">
     <tr>
    <!-- body_text //-->
       <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
         <tr>
           <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
             <tr>
               <td><h3>Automated Stock Notifications</h3><br></td>
               <td align="right"></td>
             </tr>
           </table></td>
         </tr>
         <tr>
           <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
             <tr>
               <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
                 <tr>
                   <td><?php echo TABLE_HEADING_STATUS; ?></td>
                   <td><?php echo TABLE_HEADING_FIRSTNAME; ?></td>
                   <td><?php echo TABLE_HEADING_LASTNAME; ?></td>
                   <td align="center"><?php echo TABLE_HEADING_CUSTOMERS_ID; ?></td>
                   <td align="center"><?php echo TABLE_HEADING_PRODUCTS_NAME; ?></td>
                   <td><?php echo TABLE_HEADING_PRODUCTS_ID; ?></td>
                   <td align="center"><?php echo TABLE_HEADING_EMAIL_ADDRESS; ?></td>
                 </tr>
    		<?php
    	// BEGIN Automatic Stock Notification
    
                                   // jeemdesign.com - remove all product notifications for product_id = 0 if they exist
                                  $products_zero_ct="select * from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = 0;";
                                  $resultset_zeroct = mysql_query($products_zero_ct,$link);
                                  $num77 = mysql_num_rows($resultset_zeroct);
    
                                  if ($num77 !== 0) {
                                  		 $products_zero_qry="delete from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '0' ";
                                 		 $resultset_pz = mysql_query($products_zero_qry,$link);
    								 print "CLEANUP:  Blanked " . $num77 . " records where Product_ID = 0<br><br>";
    							}  else {
    								print "CLEANUP:  No records with Product ID = 0 to clean up<br><br>";
    							}
    
                                   //look for notifications to process                                
                                   $audience = array();
    
                                   $prod_notify_qry="select distinct pd.products_name, p.products_id, pn.customers_id, c.customers_firstname, c.customers_lastname, c.customers_email_address from " . TABLE_CUSTOMERS . " c, " . TABLE_PRODUCTS_NOTIFICATIONS . " pn , " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where c.customers_id = pn.customers_id and pn.products_id = p.products_id and p.products_quantity > 0 and p.products_id = pd.products_id and pn.products_id != '0'";
    
                                   $resultset_notify = mysql_query($prod_notify_qry,$link);
    
                                   $num1 = mysql_num_rows($resultset_notify);
    
                                   if ($num1 !== 0) {
    								print $num1 . " Product Notifications to Process<br><br>";
    							}  else {
    								print "No Product Notifications to Process<br><br>";
    							}
    
                                   // process each notification, create message, send email, remove notification
                                   while ($products = mysql_fetch_array($resultset_notify)) {
                                     $audience[$products['customers_id']] = array(
                                     		   'firstname' => $products['customers_firstname'],
    									   'lastname' => $products['customers_lastname'],
    									   'customers_id' => $products['customers_id'],
    									   'products_name' => $products['products_name'],
    									   'products_id' => $products['products_id'],
    									   'email_address' => $products['customers_email_address']);
    						  	}
    
                                   reset($audience);
                                   $mailed = 0;
                                   while (list($key, $value) = each ($audience)) {
                                     if ($mailed < $max_mails) {
    
    
                                           $message2 = TEXT_NOTIFICATION1 . $value['firstname'] . ' ' . $value['lastname'] . TEXT_NOTIFICATION2 . STORE_NAME . TEXT_NOTIFICATION3 . $value['products_name'] . TEXT_NOTIFICATION4 . $value['products_id'] . TEXT_NOTIFICATION4b .  $value['products_name'] . TEXT_NOTIFICATION5 . $value['products_name'] . TEXT_NOTIFICATION6 . STORE_NAME . TEXT_NOTIFICATION7 .  $value['products_name'] . TEXT_NOTIFICATION8 . STORE_NAME; 
    
    									$to = $value['firstname'] . ' ' . $value['lastname'] . '<' . $value['email_address'] . '>'; 
    									$subject = EMAIL_SUBJECT . $value['products_name']; 
    
    									$from = "From: Customer Service<[email protected]>\r\n";  //  Change to your store's preferred FROM address
    
    									mail($to, $subject, $message2, $from); 
    
    									// increase counter of # mailed
    									$mailed++;
    
    									// delete the notification now that mail is sent	
    								   $delete_notification_qry="delete from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . $value['products_id'] . "' and customers_id = '" . $value['customers_id'] . "' ";
    
    								   $resultset_del = mysql_query($delete_notification_qry,$link);
    
    								   //echo $delete_notification_qry . "<br>";
    
    								   if ($resultset_del) {
    										print "Removed Product Notifications from table that have been emailed.<br><br>";
    									}  else {
    										print "None Removed from Product Notification Table<br><br>";
    									}
                                          ?>
    
                       					<td>DONE: </td>
    
    									<?php
    
                                     		} else {
    
    									?>
    
                       					<td>TODO: </td>
    
    									<?php
                                     	}
    							?>
    								<td><?php echo $value['firstname']; ?></td>
    								<td><?php echo $value['lastname']; ?></td>
    								<td><?php echo $value['customers_id']; ?></td>
    								<td><?php echo $value['products_name']; ?></td>
    								<td><?php echo $value['products_id']; ?></td>
    								<td><?php echo $value['email_address']; ?></td>
    					 		</tr>
    							<?php
                         			}
    							// END Automatic Stock Notification
    							?>
                             <tr>
                   <td colspan=7><br><?php echo sprintf(TEXT_NUMBER_OF_EMAILS, $mailed, mysql_num_rows($resultset_notify)); ?></td>
                 </tr>
               </table></td>
             </tr>
           </table></td>
         </tr>
       </table></td>
    <!-- body_text_eof //-->
     </tr>
    </table>
    <!-- body_eof //-->
    </body>
    <?php mysql_close($link); ?>
    </html>
    

  8. I realize this is a couple years late, but I have a client that occasionally uses animated gifs - everything else is jpg - and yes, even though it's not fashionable or hip, it works for his business and he knows how to make them - so, i edited the "On the Fly" Auto Thumbnailer using GD Library to simply ignore any gifs from processing. I searched for code for this for a long time and didn't find it for this particular contribution. I hope this helps someone. Basically in the function tep_image in catalog/includes/functions/html_output.php - I added one if statement:

     

    This:

     

    if(stristr($src, '.gif')) {

    $dont_calculate = 1;

    }

     

    Here's the whole function so you can see where to slam it:

     

    // "On the Fly" Auto Thumbnailer using GD Library, servercaching and browsercaching

    // Scales product images dynamically, resulting in smaller file sizes, and keeps

    // proper image ratio. Used in conjunction with product_thumb.php t/n generator.

    function tep_image($src, $alt = '', $width = '', $height = '', $params = '') {

     

    // if no file exists display the 'no image' file

    if (!is_file($src)) {

    $src = "images/no_image.jpg";

    }

    // Set default image variable and code

    $image = '<img src="' . $src . '"';

     

    // Don't calculate if the image is set to a "%" width

    if (strstr($width,'%') == false || strstr($height,'%') == false) {

    $dont_calculate = 0;

    } else {

    $dont_calculate = 1;

    }

     

    // Dont calculate if a pixel image is being passed (hope you dont have pixels for sale)

    if (!strstr($image, 'pixel')) {

    $dont_calculate = 0;

    } else {

    $dont_calculate = 1;

    }

     

    // DO NOT PROCESS GIFS - jeemdesign.com

    if(stristr($src, '.gif')) {

    $dont_calculate = 1;

    }

    // END - DO NOT PROCESS GIFS -jeemdesign.com

     

    // Do we calculate the image size?

    if (CONFIG_CALCULATE_IMAGE_SIZE && !$dont_calculate) {

     

    // Get the image's information

    if ($image_size = @getimagesize($src)) {

     

    $ratio = $image_size[1] / $image_size[0];

     

    // Set the width and height to the proper ratio

    if (!$width && $height) {

    $ratio = $height / $image_size[1];

    $width = intval($image_size[0] * $ratio);

    } elseif ($width && !$height) {

    $ratio = $width / $image_size[0];

    $height = intval($image_size[1] * $ratio);

    } elseif (!$width && !$height) {

    $width = $image_size[0];

    $height = $image_size[1];

    }

     

    // Scale the image if not the original size

    if ($image_size[0] != $width || $image_size[1] != $height) {

    $rx = $image_size[0] / $width;

    $ry = $image_size[1] / $height;

     

    if ($rx < $ry) {

    $width = intval($height / $ratio);

    } else {

    $height = intval($width * $ratio);

    }

     

    $image = '<img src="product_thumb.php?img=' . $src . '&w=' .

    tep_output_string($width) . '&h=' . tep_output_string($height) . '"';

    }

     

    } elseif (IMAGE_REQUIRED == 'false') {

    return '';

    }

    }

     

    // Add remaining image parameters if they exist

    if ($width) {

    $image .= ' width="' . tep_output_string($width) . '"';

    }

     

    if ($height) {

    $image .= ' height="' . tep_output_string($height) . '"';

    }

     

    if (tep_not_null($params)) $image .= ' ' . $params;

     

    $image .= ' border="0" alt="' . tep_output_string($alt) . '"';

     

    if (tep_not_null($alt)) {

    $image .= ' title="' . tep_output_string($alt) . '"';

    }

     

    $image .= '>';

     

    return $image;

    }

  9. OK, looks like an instruction is missing...

     

    ** Create a directory: /catalog/admin/quickbooks

     

    (i assumed permissions 777)

     

    This is set up in the configure.php:

     

    define ('DIR_FS_CATALOG_QUICKBOOKS', DIR_FS_ADMIN . 'quickbooks/');

     

    This is where the IIF files get uploaded. It simply didn't exist.

     

    Maybe the error reporting only goes to the non-existent qb_logs.php which then processes the errors? Looks like a couple missing pieces are making this a bit of a puzzle. It would be nice to see it a bit more organized if they are trying to entice us to buy the pro version :)

     

    hope this helps someone!

     

    J

  10. Hi all,

     

    Looking forward to trying your contribution. I have it installed, but when I go to import INVIMPORT.iif, QBACCT.iif and QBMISC.iif per your instructions, I hit "update", it thinks for a bit, then returns me to the same screen with nothing imported, no error message, no errors in the error log... Just silent error :(. Is there a way to import these iif files into the db manually? Or is there perhaps permission issues to a temp directory etc?

     

    Another thing I noticed (besides the missing Event logs which i haven't fixed yet - do you have a link to that file?) is that in the install instructions, it says to add:

     

    includes/javascript/spiffCal folder (may already exist depending on your other contributions)

     

    This was not included with the contribution, but I looked in my install (MS2) and there is a folder in /includes/javascript called "spiffyCal" - Is that the same thing? Is there a problem with the slight difference in naming?

     

    For the record, in the getting started guide, I think adding a little instruction regarding the production of iif files from QB would have saved me a lot of time -(for instance just adding the navigation in Quickbooks 2009:

     

    File / Utilities / Export / Lists as IIF files...

     

    I was hacking around with Lists... Item List... Export... csv... got lost there hehe.

     

    Please let me know if you have a clue why my QB iif files will not import? I am stuck until I can get that initial data in correct?

     

    Thanks,

     

    Jim

  11. Hi all,

     

    Looking forward to trying your contribution. I have it installed, but when I go to import INVIMPORT.iif, QBACCT.iif and QBMISC.iif per your instructions, I hit "update", it thinks for a bit, then returns me to the same screen with nothing imported, no error message, no errors in the error log... Just silent error :(. Is there a way to import these iif files into the db manually? Or is there perhaps permission issues to a temp directory etc?

     

    Another thing I noticed (besides the missing Event logs which i haven't fixed yet - do you have a link to that file?) is that in the install instructions, it says to add:

     

    includes/javascript/spiffCal folder (may already exist depending on your other contributions) 

     

    This was not included with the contribution, but I looked in my install (MS2) and there is a folder in /includes/javascript called "spiffyCal" - Is that the same thing? Is there a problem with the slight difference in naming?

     

    For the record, in the getting started guide, I think adding a little instruction regarding the production of iif files from QB would have saved me a lot of time -(for instance just adding the navigation in Quickbooks 2009:

     

    File / Utilities / Export / Lists as IIF files...

     

    I was hacking around with Lists... Item List... Export... csv... got lost there hehe.

     

    Please let me know if you have a clue why my QB iif files will not import? I am stuck until I can get that initial data in correct?

     

    Thanks,

     

    Jim

  12. Will this contribution be affected by the Important System Notice emailed by Authorize.net to all US users today?

     

    Authorize.net System Notice is as follows:

    In early October, Authorize.Net will be expanding the range of Transaction IDs issued by the payment gateway. Please read this e-mail thoroughly as it contains important information on how to ensure that your account is not affected. ...

     

    I am also trying to figure out if this change to the Transaction ID is going to effect this module before I wake up some morning to failing transactions.. Anybody?

     

    Thanks,

     

    J

  13. I am surprised nobody is chattering about this yet (except us). I got the email too and was a bit impressed that USPS was being slightly proactive. I suppose we won't hear anything until they implement this on Monday morning. Then people will be freaking out if it breaks stuff... I am watching this thread! Cross your fingers - maybe everything will be fine.

  14. I am getting the same problem and have lost some customers because of delay in the shipping quotes. I've noticed that it doesn't happen all the time. Some times the time to load is faster. I was going to upgrade to the latest contribution but based on what you've said, I think it might be an issue on the USPS end. I will also get in touch with them and find out the problem. For now the best approach seems to be to disable USPS quotes.

     

    Peace,

     

    Suhail

     

    Unfortunately, I don't think our problem is going to help you... our problem turned out to be security related between two machines (one was blocking the other). After much hair pulling, it turned out to be unrelated to USPS. Still, in my research, I see evidence of a couple times that USPS did have troubles - and I know they once changed the API all of the sudden and crippled my stores. I wish you luck. I was able to correspond directly to usps regarding the API at:

     

    USPS Internet Customer Care Center

    [email protected]

     

    They responded fairly quickly, although they basically said they weren't having any trouble. And I am sure that if they really were having server trouble with rate calculations, there would be a huge outcry from ecommerce stores everywhere. As you see, i didn't have one reply on this until... you did :(

     

    Sorry. PS - there's a debugging email you can have the xml response sent to you (if you are using USPS methods contrib). It's a commented bit of code in usps.php. That's when I figured that USPS was actually sending the response fairly quickly... the email arrived almost immediately...

     

    Good luck!

     

    J

  15. IF you are all using the USPS Methods contribution, then you may have the same problem I had today, (Dec 3, 2004)....

     

    If I try to get TRANSIT TIME I lose the abiblty to get ANYTHING. For now, I turned off "Display Transit Time" and "Display Weight" in the admin for USPS Shipping.

     

    That gets me all the quotes fine again. I don't have time today to sort out the reason why it bombs when trying to get transit time, but suspect USPS changed something since last April or May when I stopped offering Domestic USPS. Activating it today produced the problems most of you describe above and in fact, caused my checkout_shipping page to come back 404...

     

    Maybe someone can sort out the problem with getting the transit times! At least for now it quotes all the rates OK.

     

    RDB

     

    OK, I've been pulling my hair out all day on very slow xml response from usps for shipping estimates. I just went through option by option enabling and disabling - then refreshing my shipping quote and counting. What i discovered is that - if I leave "display transit time" enabled, the response from USPS servers takes 54 seconds! If not, I get a quote in 15 seconds. Nothing else I changed in the module parameters had any additional significant effect. So, it looks like whatever trouble they are having today, is similar to what happened four years ago in this thread. yay.

     

    Then I heard that Netflix had some big problem today that will delay shipping for them for a day or so - and that their site had problems - made me wonder if it was related to USPS trouble on some larger scale. Probably coincidence, but it made me wonder. It really does suck to be so dependent on someone else's service. Made me think about going back to table rate.

     

    So for tonight I am hanging it up. We'll see if it is fixed in the AM. Otherwise, perhaps they made another change in their API and didn't tell anyone again. That's what happened last time I trolled these forums.

     

    Hope this helps someone.

     

    J

  16. OK, this morning at some point on two stores - shipping quotes from usps servers seem to be VERY SLOW. Like 2 minutes. I have been looking to see if anyone else has posted - nothing yet. Perhaps it's just me? I disabled USPS, and my checkout process is quick - Fed Ex quotes are fast. just usps.php is LAGGING.

     

    Anyone got the same problem? Please post to confirm. If it's their server... (I emailed their support), I will wait and relax. In the meantime, I upgraded my USPS methods to the latest - hoping perhaps there may be a known issue already addressed... No deal. The last time i had to mess with it was because USPS decided to change their API a bit... perhaps they did again?

     

    Anyone?

     

    Thanks,

     

    Jim

  17. Yep that was it, cheers creepo, i learnt something new today too. i did know the specials section had a time option.

     

    Sometimes clients need a little interpretation. I have totally been there before - so wrapped up in my last mod that I can't see the big picture :) Just need to put it down sometimes, have a coffee and walk around hehe. Glad to be of help to someone for once!

     

    Jim

  18. Hi there, I have a client that has a version of ccgv installed, dont know which one sorry, but i know it's not the latest.

    Not really a problem more a question. My client wants to add a discount to a range of products for a specific time, however she does not want the users to click the redeem button to get the discount but have it automatically take of the discount. She assures me she has done this previously but can't redo it.

     

    I cant see how it can be done.

     

    Thanks for the help.

     

    Are you sure your client isn't just talking about setting up time limited specials? In that stock module, you can specify products at a special price (or % off) and for a limited amount of time.

     

    /catalog/admin/specials.php ?

     

    Might as well start with the simple solution first :)

     

    J

  19. Same problem here - did you ever find a solution? Thanks!

     

    OK, in usps.php, there is a function called country_list which has an array of countries. France, Metropolitan (FX) is not in that list. I've found very little info about this, but on the official usps site, I think what I gathered was that FR is the only valid country code for France. As I have loaded World Zones, I have a long list of States/Provinces for "France, Metropolitan" (FX). For the time being, I have simply gone into the countries table and changed the country code for France, Metropolitan from "FX" to "FR". From what I read, it sounds like "FX" is just the Paris Metro area.

     

    Not sure who included FX in the country list in oscommerce, but it's not valid to USPS.

     

    As soon as I made the change, my customer, without changing his address, was able to pull rate quotes from USPS and FedEx.

     

    Hopefully, they are correct.

     

    Hope this helps someone. I was scratching my head for awhile.

     

    J

  20. Using USPS Methods, the contribution gave an error for "France, Metropolitan". It failed to give a quote and came up with error: -2147219080 - Missing value for Country.

     

    I see several problems with this the last few years in searching, but no solutions... <_<

     

    The Country Codes are there: FX and FXX. Are these valid for USPS?

     

    Anyone at all have any ideas or a solution?

     

    Thanks for your help.

     

    RDB

     

    Same problem here - did you ever find a solution? Thanks!

  21. Thanks everybody, you saved my arse again. That's what I love about Open Source community :) I wasn't the only one freaking out and whew...

     

    All I did was edit my existing usps.php with the new stuff from the new contribution:

     

    $this->types = array('EXPRESS' => 'EXPRESS', 'FIRST CLASS' => 'First-Class Mail', 'PRIORITY' => 'PRIORITY', 'PARCEL' => 'Parcel', 'BPM' => 'Bound Printed Material', 'LIBRARY' => 'Library', 'MEDIA' => 'Media Mail');

     

    $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 INT' => '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');

     

    Then applied their update.sql:

     

    UPDATE configuration

    SET configuration_value = UPPER(configuration_value),

    set_function='tep_cfg_select_multioption(array(''GLOBAL EXPRESS'', ''GLOBAL EXPRESS NON-DOC RECT'', ''GLOBAL EXPRESS NON-DOC NON-RECT'', ''EXPRESS MAIL INT'', ''EXPRESS MAIL INT FLAT RATE ENV'', ''PRIORITY MAIL INT'', ''PRIORITY MAIL INT FLAT RATE ENV'', ''PRIORITY MAIL INT FLAT RATE BOX'', ''FIRST-CLASS MAIL INT''), '

    WHERE configuration_key='MODULE_SHIPPING_USPS_TYPES_INTL';

     

    UPDATE configuration

    SET configuration_value = UPPER(configuration_value),

    set_function='tep_cfg_select_multioption(array(''EXPRESS'', ''PRIORITY'', ''FIRST CLASS'', ''PARCEL'', ''BPM'', ''LIBRARY'', ''MEDIA''), '

    WHERE configuration_key='MODULE_SHIPPING_USPS_TYPES'

     

    Seems like it fixed it. Tested Domestic and international orders. Nice of USPS to warn us eh?

     

    J

  22. I get the following error in my admin section when I want to enter a new event:

     

    Fatal error: Cannot use string offset as an array in /home/vhosts/5000138084/ultimate-store.net/htdocs/shop/admin/includes/classes/table_block.php on line 67

     

    plz hlp me solving this problem

    regards chris

     

    same problem here - seems to be a php5 issue. Help?

     

    Line 67:

     

    $tableBox_string .= '>' . $contents[$i]['text'] . '</td>' . "\n";

     

    Thanks!

     

    J

×
×
  • Create New...