Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Is USPS shipping module down


heartbroke

Recommended Posts

yeah, the new USPS rates went into affect last night, so there was apparently some other changes too. Hoping it's like last year where it's just a simple set of service name changes but I couldn't figure it out this morning. My domestic shipping is working fine, but my international is broken. Hopefully some of the code guru's on here are looking into it already.

Link to comment
Share on other sites

my site is also showing weird ampersand characters after the domestic service names (but at least its grabbing the prices)

Priority Mail<sup>&reg;</sup> $13.63

Express Mail<sup>&reg;</sup> $40.33

 

so basically we have no choice but to wait for USPS to fix the international API it on their end?

Link to comment
Share on other sites

I just contacted the USPS webtools help line.

they say it's a coding issue,, but it isnt on their end (because amazon uses the same server).

your admin need to email them at [email protected]

let them know the XML string you are using, what server it is contacting, and what response you are getting back from them.

instructional help code cannot really be given over the phone.

( i dont do my website's admin or programming so i cannot help at this point)

if any one you get the answer before her, please post asap!

Link to comment
Share on other sites

my site is also showing weird ampersand characters after the domestic service names (but at least its grabbing the prices)

Priority Mail<sup>&reg;</sup> $13.63

Express Mail<sup>&reg;</sup> $40.33

 

so basically we have no choice but to wait for USPS to fix the international API it on their end?

 

I get the same message on a couple of my stores. The stuff in the middle

<sup>&reg;</sup>

appears to have something to to with the html code for the "®" character? So instead of picking up the character it's picking up the html code instead.

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 get the same message on a couple of my stores. The stuff in the middle

<sup>&reg;</sup>

appears to have something to to with the html code for the "®" character? So instead of picking up the character it's picking up the html code instead.

Yes. The USPS is feeding something like this out their API:

Media Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt;

 

When, really, they want:

Media Mail<sup>®</sup>

 

To make "Media Mail®"

 

It looks like they fed it through their de-HTML-ifier two times too many. Ech.

 

Anyway, I just got off the phone with the US Postal service. They say they are aware of the issue and will fix it by the close of business today (Sunday, January 2).

 

They also said that they were aware of the International rates issue, and would fix that, too. It sounded like it was related. I was less convinced.

 

If you're desperate enough to take international orders today, I'd recommend implementing some sort of flat rate shipping module until the USPS straightens this out. That's not dependent on the USPS API.

Link to comment
Share on other sites

Yes. The USPS is feeding something like this out their API:

Media Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt;

 

When, really, they want:

Media Mail<sup>®</sup>

 

To make "Media Mail®"

 

It looks like they fed it through their de-HTML-ifier two times too many. Ech.

 

Anyway, I just got off the phone with the US Postal service. They say they are aware of the issue and will fix it by the close of business today (Sunday, January 2).

 

They also said that they were aware of the International rates issue, and would fix that, too. It sounded like it was related. I was less convinced.

 

 

Thanks for taking the initiative to make the phone call on that Dan. All I have to do now is put my trust in the government to fix something. :)

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

They say they are aware of the issue and will fix it by the close of business today (Sunday, January 2).

 

They also said that they were aware of the International rates issue, and would fix that, too. It sounded like it was related. I was less convinced.

 

 

Not fixed yet and I believe the "business day" has ended. Specially in EST.

Link to comment
Share on other sites

I doubt seriously that the USPS really believes they are at fault and are going to "fix" anything. I bet we're on our own.

 

I got the e-mail from USPS on 12/16 and had hoped that someone had a fix prepared by now. It seemed obvious that the level of changes were extensive and appeared to be completely documented in the e-mail, including addresses to test environment APIs. I'm no php-coder, but this shouldn't have been a surprise to those in the know in the OSCommerce community.

 

Anyway, domestic shipping is working fine for me (using USPS module 2.9.6), but International is completely broken. The following message appears for any international address -

An error occured with the USPS shipping calculations.

If you prefer to use USPS as your shipping method, please contact the store owner.

 

Of course - I already have international customers reporting trouble at my store. :( Please help!

Link to comment
Share on other sites

My quick fix for USPS domestic rates was to just strip out all the new characters on the $type variable before it builds the shipping quotes array. I have a heavily modified usps.php modules file so I cannot show you exactly where, but basically find where the quotes array is built from the USPS response and add this code:

 

Mine looks like this:

 

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

 

so I added this after:

 

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

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

$type = str_replace('**', '', $type);

 

This removes the everything that was added by USPS that was causing errors on my site. It also fixes the international issue (response had added a ** to the end of the title).

 

Hope this helps!

Link to comment
Share on other sites

This did nothing for me. Are you using USPS Methods contribution?

 

 

My quick fix for USPS domestic rates was to just strip out all the new characters on the $type variable before it builds the shipping quotes array. I have a heavily modified usps.php modules file so I cannot show you exactly where, but basically find where the quotes array is built from the USPS response and add this code:

 

Mine looks like this:

 

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

 

so I added this after:

 

$type = str_replace('<sup>&amp;reg;</sup>', '', $type);

$type = str_replace('<sup>&amp;trade;</sup>', '', $type);

$type = str_replace('**', '', $type);

 

This removes the everything that was added by USPS that was causing errors on my site. It also fixes the international issue (response had added a ** to the end of the title).

 

Hope this helps!

Link to comment
Share on other sites

My quick fix for USPS domestic rates was to just strip out all the new characters on the $type variable before it builds the shipping quotes array. I have a heavily modified usps.php modules file so I cannot show you exactly where, but basically find where the quotes array is built from the USPS response and add this code:

 

Mine looks like this:

 

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

 

so I added this after:

 

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

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

$type = str_replace('**', '', $type);

 

This removes the everything that was added by USPS that was causing errors on my site. It also fixes the international issue (response had added a ** to the end of the title).

 

Hope this helps!

 

Thanks very much!

It worked for me.

Edited by chocolategelt
Link to comment
Share on other sites

This did nothing for me. Are you using USPS Methods contribution?

 

Yes I am. Since the titles have changed for some of the shipping class types you have to be sure that what you have populated in your Configuration table > configuration_title = Shipping Methods record matches what USPS sends in their response.

 

Using my code the stripped response for domestic services looks like this now:

 

Express Mail

Express Mail Sunday/Holiday Delivery

Express Mail Flat Rate Envelope

Express Mail Sunday/Holiday Delivery Flat Rate Envelope

Express Mail Legal Flat Rate Envelope

Express Mail Sunday/Holiday Delivery Legal Flat Rate Envelope

Priority Mail

Priority Mail Large Flat Rate Box

Priority Mail Medium Flat Rate Box

Priority Mail Small Flat Rate Box

Priority Mail Flat Rate Envelope

Priority Mail Legal Flat Rate Envelope

Priority Mail Padded Flat Rate Envelope

Priority Mail Gift Card Flat Rate Envelope

Priority Mail Small Flat Rate Envelope

Priority Mail Window Flat Rate Envelope

Parcel Post

Media Mail

Library Mail

 

And for International (Canada was my test country):

 

Global Express Guaranteed (GXG)

Global Express Guaranteed Non-Document Rectangular

USPS GXG Envelopes

Express Mail International

Express Mail International Flat Rate Envelope

Express Mail International Legal Flat Rate Envelope

Priority Mail International

Priority Mail International Flat Rate Envelope

Priority Mail International Legal Flat Rate Envelope

Priority Mail International Padded Flat Rate Envelope

Priority Mail International Gift Card Flat Rate Envelope

Priority Mail International Small Flat Rate Envelope

Priority Mail International Window Flat Rate Envelope

First-Class Mail International Package

First-Class Mail International Large Envelope

 

If these service names do not match what you have populated in the configuration_title = Shipping Methods record then these services will not display. Be sure you update both the configuration_value & set_function with the updated service names.

Edited by grapesmuggler
Link to comment
Share on other sites

Yes I am. Since the titles have changed for some of the shipping class types you have to be sure that what you have populated in your Configuration table > configuration_title = Shipping Methods record matches what USPS sends in their response.

 

Using my code the stripped response for domestic services looks like this now:

 

Express Mail

Express Mail Sunday/Holiday Delivery

Express Mail Flat Rate Envelope

Express Mail Sunday/Holiday Delivery Flat Rate Envelope

Express Mail Legal Flat Rate Envelope

Express Mail Sunday/Holiday Delivery Legal Flat Rate Envelope

Priority Mail

Priority Mail Large Flat Rate Box

Priority Mail Medium Flat Rate Box

Priority Mail Small Flat Rate Box

Priority Mail Flat Rate Envelope

Priority Mail Legal Flat Rate Envelope

Priority Mail Padded Flat Rate Envelope

Priority Mail Gift Card Flat Rate Envelope

Priority Mail Small Flat Rate Envelope

Priority Mail Window Flat Rate Envelope

Parcel Post

Media Mail

Library Mail

 

And for International (Canada was my test country):

 

Global Express Guaranteed (GXG)

Global Express Guaranteed Non-Document Rectangular

USPS GXG Envelopes

Express Mail International

Express Mail International Flat Rate Envelope

Express Mail International Legal Flat Rate Envelope

Priority Mail International

Priority Mail International Flat Rate Envelope

Priority Mail International Legal Flat Rate Envelope

Priority Mail International Padded Flat Rate Envelope

Priority Mail International Gift Card Flat Rate Envelope

Priority Mail International Small Flat Rate Envelope

Priority Mail International Window Flat Rate Envelope

First-Class Mail International Package

First-Class Mail International Large Envelope

 

If these service names do not match what you have populated in the configuration_title = Shipping Methods record then these services will not display. Be sure you update both the configuration_value & set_function with the updated service names.

 

Are you able to receive International and Domestic Rates? I am only receiving Domestic rates still. I looked through the Database to see what we had for International Services and this is what we had:

 

Priority Mail International

First-Class Mail International Package

 

We don't offer any other International services, however these aren't displaying to the customer.

Link to comment
Share on other sites

Are you able to receive International and Domestic Rates? I am only receiving Domestic rates still. I looked through the Database to see what we had for International Services and this is what we had:

 

Priority Mail International

First-Class Mail International Package

 

We don't offer any other International services, however these aren't displaying to the customer.

 

Yes I am able to get both domestic and international rates returned. To test what you are getting from the response from usps just add some code like this in the modules > shipping > usps.php after where you strip the $type: echo "USPS $type @ $cost<br>";. This will allow you to see what the exact response is and you can compare it to what you have populated. Hope that is helpful!

Link to comment
Share on other sites

Hey Heather...which USPS methods version are you running? Could you supply your full code for both the languages (if it's changed) and the main usps.php file?

 

Yes I am. Since the titles have changed for some of the shipping class types you have to be sure that what you have populated in your Configuration table > configuration_title = Shipping Methods record matches what USPS sends in their response.

 

Using my code the stripped response for domestic services looks like this now:

 

Express Mail

Express Mail Sunday/Holiday Delivery

Express Mail Flat Rate Envelope

Express Mail Sunday/Holiday Delivery Flat Rate Envelope

Express Mail Legal Flat Rate Envelope

Express Mail Sunday/Holiday Delivery Legal Flat Rate Envelope

Priority Mail

Priority Mail Large Flat Rate Box

Priority Mail Medium Flat Rate Box

Priority Mail Small Flat Rate Box

Priority Mail Flat Rate Envelope

Priority Mail Legal Flat Rate Envelope

Priority Mail Padded Flat Rate Envelope

Priority Mail Gift Card Flat Rate Envelope

Priority Mail Small Flat Rate Envelope

Priority Mail Window Flat Rate Envelope

Parcel Post

Media Mail

Library Mail

 

And for International (Canada was my test country):

 

Global Express Guaranteed (GXG)

Global Express Guaranteed Non-Document Rectangular

USPS GXG Envelopes

Express Mail International

Express Mail International Flat Rate Envelope

Express Mail International Legal Flat Rate Envelope

Priority Mail International

Priority Mail International Flat Rate Envelope

Priority Mail International Legal Flat Rate Envelope

Priority Mail International Padded Flat Rate Envelope

Priority Mail International Gift Card Flat Rate Envelope

Priority Mail International Small Flat Rate Envelope

Priority Mail International Window Flat Rate Envelope

First-Class Mail International Package

First-Class Mail International Large Envelope

 

If these service names do not match what you have populated in the configuration_title = Shipping Methods record then these services will not display. Be sure you update both the configuration_value & set_function with the updated service names.

Link to comment
Share on other sites

Yes I am able to get both domestic and international rates returned. To test what you are getting from the response from usps just add some code like this in the modules > shipping > usps.php after where you strip the $type: echo "USPS $type @ $cost<br>";. This will allow you to see what the exact response is and you can compare it to what you have populated. Hope that is helpful!

 

 

Hi, Can you please post your completed USPS.PHP? I see all the International quote but it will default back to Global Express Guaranteed (GXG) when I check out the items??? Please help.

Link to comment
Share on other sites

My quick fix for USPS domestic rates was to just strip out all the new characters on the $type variable before it builds the shipping quotes array. I have a heavily modified usps.php modules file so I cannot show you exactly where, but basically find where the quotes array is built from the USPS response and add this code:

 

Mine looks like this:

 

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

 

so I added this after:

 

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

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

$type = str_replace('**', '', $type);

 

This removes the everything that was added by USPS that was causing errors on my site. It also fixes the international issue (response had added a ** to the end of the title).

 

Hope this helps!

 

 

This worked for me!!!!!

Both domestic and international rates are working!

THANX!!!!!!!

 

Kurt

Link to comment
Share on other sites

How to fix this problem?

 

1. ADD THIS FUNCTION TO admin/includes/functions/general.php

// USPS Methods 3.0

// Alias function for Store configuration values in the Administration Tool

function tep_cfg_select_multioption($select_array, $key_value, $key = '')

 

{

for ($i=0; $i<sizeof($select_array); $i++) {

$name = (($key) ? 'configuration[' . $key . '][]' :

 

'configuration_value');

$string .= '<br><input type="checkbox" name="' . $name . '" value="'

 

. $select_array[$i] . '"';

$key_values = explode( ", ", $key_value);

if ( in_array($select_array[$i], $key_values) ) $string .= '

 

CHECKED';

$string .= '> ' . $select_array[$i];

}

$string .= '<input type="hidden" name="' . $name . '"

 

value="--none--">';

return $string;

}

 

2. Install the last version of this contribution

http://www.oscommerce.com/community/contributions,487

 

Thanks

Link to comment
Share on other sites

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...