Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

USPS Methods 4_3_2 2011 Jan 2 Issue


altoid

Recommended Posts

I have two shops running osCommerce Online Merchant v2.2 RC2a that had the same issue with USPS that cropped up around 2 Jan 2011.

 

The posts seeking and offering help over at [Contribution] - USPS Methods USPS Methods Support was getting a lot of traffic, so I thought I'd put this here in case it would help someone using USPS Methods 4_3_2

 

Please read my signature line, I am not an expert, but I've learned enough to piece things together sometimes and the sole purpose of this post is to show what I did that got my USPS shipping working again after the 2 Jan event. Just trying to help is all...

 

If you try this, do the back up thing. You know that I mean.

 

The instructions for the method I use starts with:

 

*********************************************
* USPSMethods 4.3.0 for osCommerce MS2 RC2a *  For donations to Greg/naps1saps please go to epicdecals.com and click the donate link at the bottom of the page
*    Submitted 03-01-2008 by olsonsp4c	    *  For donations to all other names, please contact them directly on the forum.
* REVISED AND EDITED 09-08-08 by naps1saps  *
*         Released under the GPL            *
*********************************************

Copyright 2/20/03 by Brad Waite with revisions by Fritz Clapp and many others
Instructions for an already modified store added by Steel Shadow and many others

If you are having problems, go to our forum: 
http://www.oscommerce.com/forums/index.php?showtopic=146950&st=360&gopid=1247661entry1247661

 

That may help you determine if if your method add on is the same as mine.

 

After mining through the posts over in [Contribution] - USPS Methods USPS Methods Support here's what I gleaned out and it works for me:

 

My USPS fix is based off of this post:

http://www.oscommerce.com/forums/topic/146950-contribution-usps-methods/page__view__findpost__p__1556014

 

dsolutions said:

“Just wanted to post what worked for me to get the domestic and international working. I have been watching this forum and trying what people post. Here is my source for usps.php.

 

I put //new code where I added the code, and I also deleted the EMS from the international array options.”

 

So here's what I did in the module.

 

line 581

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

//new code

$service = htmlspecialchars_decode($regs[1]);

$service = preg_replace('/\<sup\>\&reg;\<\/sup\>/', '<sup>®</sup>', $service);

//end new code

//$service = $regs[1];

//end new code

 

line 716

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

$service = $regs[1];

//new code

$service = str_replace('&lt;sup&gt;&amp;reg;&lt;/sup&gt;', '', $service);

$service = str_replace('&lt;sup&gt;&amp;trade;&lt;/sup&gt;', '', $service);

//end new code

 

And then I changed

'EXPRESS INT' => 'Express Mail International (EMS)',

'EXPRESS INT FLAT RATE ENV' => 'Express Mail International (EMS) Flat-Rate Envelope',

to

'EXPRESS INT' => 'Express Mail International',

'EXPRESS INT FLAT RATE ENV' => 'Express Mail International Flat-Rate Envelope',

 

Then in post:

http://www.oscommerce.com/forums/topic/146950-contribution-usps-methods/page__view__findpost__p__1556071

 

dingdongkk said:

“Confirmed, working off Posted 756, I got International rates back,

You have to change

 

'FIRST-CLASS INT' => 'First-Class Mail International Package**');

In order to get the First Class international rate showing per PEBR sugguest”

 

But that did not apply to my situation because my module coding was different. So I came up with this.

 

In the file this is around line 84, changed as follows:

'FIRST-CLASS INT' => 'First-Class Mail International ' . $this->FirstClassIntType);

 

and

 

Around line 68 change as follows:

 

//FIRST CLASS MAIL INTERNATIONAL OPTION:

$this->FirstClassIntType = 'Package**'; //OPTIONS: 'Letters', 'Large Envelope', 'Package**'

 

That got things working, I’ve checked it several days in a row testing a dummy US and Canadian customer. I get first class domestic and international, as well as domestic and international priority showing correctly in the store.

 

I wish I had more technical background to offer more help on this; so please take this as is intended. If it doesn't work for you then likely your module has some modification that effects why mine works and your's doesn't. That's about as much help I can offer.

 

Good luck.

I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can.

I remember what it was like when I first started with osC. It can be overwhelming.

However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc.

There are several good pros here on osCommerce. Look around, you'll figure out who they are.

Link to comment
Share on other sites

I have two shops running osCommerce Online Merchant v2.2 RC2a that had the same issue with USPS that cropped up around 2 Jan 2011.

 

The posts seeking and offering help over at [Contribution] - USPS Methods USPS Methods Support was getting a lot of traffic, so I thought I'd put this here in case it would help someone using USPS Methods 4_3_2

 

Please read my signature line, I am not an expert, but I've learned enough to piece things together sometimes and the sole purpose of this post is to show what I did that got my USPS shipping working again after the 2 Jan event. Just trying to help is all...

 

If you try this, do the back up thing. You know that I mean.

 

The instructions for the method I use starts with:

 

*********************************************
* USPSMethods 4.3.0 for osCommerce MS2 RC2a *  For donations to Greg/naps1saps please go to epicdecals.com and click the donate link at the bottom of the page
*    Submitted 03-01-2008 by olsonsp4c	    *  For donations to all other names, please contact them directly on the forum.
* REVISED AND EDITED 09-08-08 by naps1saps  *
*         Released under the GPL            *
*********************************************

Copyright 2/20/03 by Brad Waite with revisions by Fritz Clapp and many others
Instructions for an already modified store added by Steel Shadow and many others

If you are having problems, go to our forum: 
http://www.oscommerce.com/forums/index.php?showtopic=146950&st=360&gopid=1247661entry1247661

 

That may help you determine if if your method add on is the same as mine.

 

After mining through the posts over in [Contribution] - USPS Methods USPS Methods Support here's what I gleaned out and it works for me:

 

My USPS fix is based off of this post:

http://www.oscommerce.com/forums/topic/146950-contribution-usps-methods/page__view__findpost__p__1556014

 

dsolutions said:

“Just wanted to post what worked for me to get the domestic and international working. I have been watching this forum and trying what people post. Here is my source for usps.php.

 

I put //new code where I added the code, and I also deleted the EMS from the international array options.”

 

So here's what I did in the module.

 

line 581

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

//new code

$service = htmlspecialchars_decode($regs[1]);

$service = preg_replace('/\<sup\>\&reg;\<\/sup\>/', '<sup>®</sup>', $service);

//end new code

//$service = $regs[1];

//end new code

 

line 716

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

$service = $regs[1];

//new code

$service = str_replace('&lt;sup&gt;&amp;reg;&lt;/sup&gt;', '', $service);

$service = str_replace('&lt;sup&gt;&amp;trade;&lt;/sup&gt;', '', $service);

//end new code

 

And then I changed

'EXPRESS INT' => 'Express Mail International (EMS)',

'EXPRESS INT FLAT RATE ENV' => 'Express Mail International (EMS) Flat-Rate Envelope',

to

'EXPRESS INT' => 'Express Mail International',

'EXPRESS INT FLAT RATE ENV' => 'Express Mail International Flat-Rate Envelope',

 

Then in post:

http://www.oscommerce.com/forums/topic/146950-contribution-usps-methods/page__view__findpost__p__1556071

 

dingdongkk said:

“Confirmed, working off Posted 756, I got International rates back,

You have to change

 

'FIRST-CLASS INT' => 'First-Class Mail International Package**');

In order to get the First Class international rate showing per PEBR sugguest”

 

But that did not apply to my situation because my module coding was different. So I came up with this.

 

In the file this is around line 84, changed as follows:

'FIRST-CLASS INT' => 'First-Class Mail International ' . $this->FirstClassIntType);

 

and

 

Around line 68 change as follows:

 

//FIRST CLASS MAIL INTERNATIONAL OPTION:

$this->FirstClassIntType = 'Package**'; //OPTIONS: 'Letters', 'Large Envelope', 'Package**'

 

That got things working, I’ve checked it several days in a row testing a dummy US and Canadian customer. I get first class domestic and international, as well as domestic and international priority showing correctly in the store.

 

I wish I had more technical background to offer more help on this; so please take this as is intended. If it doesn't work for you then likely your module has some modification that effects why mine works and your's doesn't. That's about as much help I can offer.

 

Good luck.

 

 

Should this work running Version osCommerce Online Merchant v2.2 RC1

Link to comment
Share on other sites

line 581
           $service = ereg('<MailService>(.*)</MailService>', $response[$i], $regs);
		//new code 
		$service = htmlspecialchars_decode($regs[1]); 
		$service = preg_replace('/\<sup\>\&reg;\<\/sup\>/', '<sup>®</sup>', $service); 
		//end new code                         
		//$service = $regs[1]; 
		//end new code

 

Mike, I think you got an error here, I think this should be

			//end new code                         
		$service = $regs[1]; 

 

 

But in any case.. this is doing the same thing I had with the 5.0.1 fix. International appears to be working fine, though I am not getting handling fees added (I could swear I was before) and domestic -- if ANY of the rates are checked, I am betting a blank white page. If NO domestic rates checked at all I get an error response from USPS.

 

In the mean time, I contacted ozeworks who contributed USPS Methods 4.3.2 Fix international services Jan 10, 2010 and he gave me a file that did work for me. Your milage may vary.. those having white page issues, try this replacement USPS Methods Alternative 2011 fix

Edited by wkdwich

Debbie D
Franklin County, VA "Moonshine Capitol of the World"
osCmax Mobile Template oscmaxtemplates.com

Link to comment
Share on other sites

line 581
           $service = ereg('<MailService>(.*)</MailService>', $response[$i], $regs);
		//new code 
		$service = htmlspecialchars_decode($regs[1]); 
		$service = preg_replace('/\<sup\>\&reg;\<\/sup\>/', '<sup>®</sup>', $service); 
		//end new code                         
		//$service = $regs[1]; 
		//end new code

 

Mike, I think you got an error here, I think this should be

			//end new code                         
		$service = $regs[1]; 

 

 

Hi there, in my case my shipping would not work with the code :

 

code] //end new code

$service = $regs[1];

[/code]

 

To get it to work, I had to comment out the

 

//$service = $regs[1];

 

That code is what I copied as noted above from this post:

 

I did try the code both ways in my shop, but only the commented out code worked.

 

I wish I knew code better to explain why it works but the code in that post is what I am using and it's working.

 

Thanks

I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can.

I remember what it was like when I first started with osC. It can be overwhelming.

However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc.

There are several good pros here on osCommerce. Look around, you'll figure out who they are.

Link to comment
Share on other sites

Should this work running Version osCommerce Online Merchant v2.2 RC1

 

My apologies, but I am not that code savy to respond, perhaps someone with more coding knowledge could answer. My shop where it's working is a v2.2 RC2a shop.

 

Thanks

I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can.

I remember what it was like when I first started with osC. It can be overwhelming.

However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc.

There are several good pros here on osCommerce. Look around, you'll figure out who they are.

Link to comment
Share on other sites

In addition to my post #1 add this code to the usps.php module file and it will allow your admin side to show the shipping title correctly....if you look closely toward the end of each code snippet you will see the change with the "**" part. Please see post #1 to help you decide if this may or may not apply to the method you are using.

 

If you try it B A C K U P

 

somewhere around line 256 (in my file anyway),

 

changed this:

 

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', '', 'Select the international services to be offered:', '6', '15', 'tep_cfg_select_multioption(array(\'Global Express Guaranteed (GXG)\', \'Global Express Guaranteed Non-Document Rectangular\', \'Global Express Guaranteed Non-Document Non-Rectangular\',\'USPS GXG Envelopes\', \'Express Mail International\', \'Express Mail International Flat Rate Envelope\', \'Priority Mail International\', \'Priority Mail International Large Flat Rate Box\',\'Priority Mail International Medium Flat Rate Box\',\'Priority Mail International Small Flat Rate Box\',\'Priority Mail International Flat Rate Envelope\', \'First-Class Mail International Package\', \'First-Class Mail International Large Envelope\'), ', now())");

 

to this:

 

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', '', 'Select the international services to be offered:', '6', '15', 'tep_cfg_select_multioption(array(\'Global Express Guaranteed (GXG)\', \'Global Express Guaranteed Non-Document Rectangular\', \'Global Express Guaranteed Non-Document Non-Rectangular\',\'USPS GXG Envelopes\', \'Express Mail International\', \'Express Mail International Flat Rate Envelope\', \'Priority Mail International\', \'Priority Mail International Large Flat Rate Box\',\'Priority Mail International Medium Flat Rate Box\',\'Priority Mail International Small Flat Rate Box\',\'Priority Mail International Flat Rate Envelope\', \'First-Class Mail International Package**\', \'First-Class Mail International Large Envelope\'), ', now())");

I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can.

I remember what it was like when I first started with osC. It can be overwhelming.

However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc.

There are several good pros here on osCommerce. Look around, you'll figure out who they are.

Link to comment
Share on other sites

AbyssRecords, on 05 January 2011 - 11:41 PM, said:

 

Should this work running Version osCommerce Online Merchant v2.2 RC1

 

I'm not real technically savvy either, but you should have no trouble with this or the version I uploaded or maybe fulluvscent's version. I have not been able to determine why fulluvscents version gave me white screens, this one does not. I tried comparing the files but there are too many differences for me to decipher it

Debbie D
Franklin County, VA "Moonshine Capitol of the World"
osCmax Mobile Template oscmaxtemplates.com

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...