PDA

View Full Version : error using USPS



geeknano
05-14-2007, 08:02 AM
I get this error during checkout.

An error occured with the USPS shipping calculations.
If you prefer to use USPS as your shipping method, please contact the store owner.

I had a site running and I have used this module before with all the correct setting for almost 100 orders before this. Its just that I migrated to a different server and now this module doesnt seem to work.

Please help as I have a live shop and I desperately need help as I am out of all ideas :(
Thanks
Nilesh

jpf
05-14-2007, 10:59 AM
I get this error during checkout.

An error occured with the USPS shipping calculations.
If you prefer to use USPS as your shipping method, please contact the store owner.

I had a site running and I have used this module before with all the correct setting for almost 100 orders before this. Its just that I migrated to a different server and now this module doesnt seem to work.

Please help as I have a live shop and I desperately need help as I am out of all ideas :(
Thanks
Nilesh

Double check your configure.php files - if you moved servers your path may have changed.

geeknano
05-14-2007, 05:56 PM
thanks you very much for the reply ? do you know what exactly would affect this in configure.php ? i mean what path is related to the shipping module or usps or maybe checkout page ?
Thanks

jpf
05-15-2007, 08:07 AM
Possibly:
define('DIR_FS_CATALOG', '....your web servers path to your install....');
and/or
define('HTTP_COOKIE_DOMAIN', 'your domain');
define('HTTPS_COOKIE_DOMAIN', 'your domain-maybe different');
define('HTTP_COOKIE_PATH', '/catalog/');
define('HTTPS_COOKIE_PATH', '/catalog-maybe different/');
define('DIR_WS_HTTP_CATALOG', '/catalog/');
define('DIR_WS_HTTPS_CATALOG', '/catalog-maybe different/');

sting01
07-09-2007, 12:55 AM
USPS changed the naming in the 14th oy may 2007, by so you do have to change the file : inlcudes/module/shipping/usps.php


1) near line 54

//$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 Envelope (single)',
// 'Airmail Letter' => 'Airmail Letter Post',
// 'Airmail Parcel' => 'Airmail Parcel Post',
// 'Surface Letter' => 'Economy (Surface) Letter Post',
// 'Surface Post' => 'Economy (Surface) Parcel Post');

//E.Bianchetti as per USPS new system of 14th of may 2007

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




2) near line 154

//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 ('Int\'l Shipping Methods', 'MODULE_SHIPPING_USPS_TYPES_INTL', 'GXG Document, GXG Non-Document, Express, Priority Lg, Priority Sm, Priority Var, Airmail Letter, Airmail Parcel, Surface Letter, Surface Post', 'Select the international services to be offered:', '6', '15', 'tep_cfg_select_multioption(array(\'GXG Document\', \'GXG Non-Document\', \'Express\', \'Priority Lg\', \'Priority Sm\', \'Priority Var\', \'Airmail Letter\', \'Airmail Parcel\', \'Surface Letter\', \'Surface Post\'), ', now())");

//E.Bianchetti mod as per USPS changes the 14th of may 2007
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 ('Int\'l Shipping Methods', 'MODULE_SHIPPING_USPS_TYPES_INTL', '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', 'Select the international services to be offered:', '6', '15', '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\'), ', now())");


3) near line 400 (not sure if the file was modified earlier, but I had to do that call to the db to make it work)

$query= "select * from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_USPS_TYPES_INTL'";
$action = mysql_query($query) or die (mysql_error());
while($values=mysql_fetch_array($action)) {
$test_eric = $values['configuration_value'];
}

foreach( explode(", ", $test_eric) as $value ) {
$allowed_types[$value] = $this->intl_types[$value];
}

instead of

foreach( explode(", ",MODULE_SHIPPING_USPS_TYPES_INTL) as $value ) $allowed_types[$value] = $this->intl_types[$value];

wkdwich
07-27-2007, 07:01 AM
I am having this problem with a fresh install also.. I have a USPS account working in another shopping cart (not osC).. I can get domestic shipping but not international.. I called USPS and (grr was oon hold forever!) they say since I am already using the account on another cart I am set to production, nothing for them to do..

I altered the file as you suggest here, but when I click install nothing happens at all..

Can someone send me the altered corrected file?? thanks

I need: catalog\includes\modules\shipping\usps.php corrected for the new USPS rules

wkdwich
07-27-2007, 11:55 AM
Anyone?? I am ready to open the store except for this error.. please can someone help?

met00
07-27-2007, 03:42 PM
okay, this is called debugging, but what is USPS returning? For instance,m when I was having a similar problem with UPS I checked and found that I had a max weight that was larger than UPSs max weight and the actual message being returned by UPS told me what the problem was.

so the questions in debugging in order are:
1) am I getting to the production server?
2) what is the production server returning as a response?

If you aren't even getting to the production server, then the odds are that you don't have something configured properly.

If you are getting there, then they will tell you what the problems are.

wkdwich
07-27-2007, 08:38 PM
I did get it to work this morning, and got so involved getting things ready to open the store I forgot to respond.. here is what I accomplished:

performed sql update

UPDATE `configuration` SET `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' LIMIT 1 ;


uninstalled the USPS module

uploaded bkpie's copy from this post:
http://www.oscmax.com/forums/oscmax-v2-customization-mods/9222-going-postal.html#post27874

and reinstalled.. eveyrthing works fine now thanks for the response

sting01
07-29-2007, 06:43 PM
You right, in the fix I posted I simply forgot the SQL. Anyway it was a fix I did in 10 mn for my ex employer (the new coder is not able to create something like that lol), so I simply worked fast and when I posted I forgot that.

On the other hand, Osc = Free sofware. My phylosophy is anyone who use free sofware have to learn a bit about it (same as a race pilot know how the car is working), and certainly not rely on : "Send me the files modified". It would be a lazy attitude.

wkdwich
07-29-2007, 08:06 PM
You are so right.. I can not belive what I have learned about PHP and SQL since I started up with osc almost a year ago.. I did ask for the modified file out of sheer frustratuion though I will admit.. not out of laziness :)

Goog job on the fix BTW.. I can hack someone else's code and mod osc given the proper info.. but I can not write sql queries or php to save my life.. I read it and can understand the flow for the most part.. but I can not commit the how to from scratch :)

telder
11-20-2007, 02:03 PM
Where do you enter the SQL query to update the SQL??

jpf
11-20-2007, 03:11 PM
Into phpMyAdmin.... or use your SQL management tool.

In phpMyAdmin - login as required by your hosting services... Select the oscMax database. then Click on query tab and enter


UPDATE `configuration` SET `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' LIMIT 1 ; Press submit....

countingsheep
12-06-2007, 04:34 PM
Where do you enter the SQL query to update the SQL??

Is this a required update for recent USPS changes for OSCMAX?

wkdwich
12-06-2007, 06:52 PM
Sheep, yes, required if you want people charged priority and not express