Zen Cart Logo
Forums / Addon Shipping Modules / USPS module suddenly not giving correct insurance rates?

USPS module suddenly not giving correct insurance rates?

Views: 3,228

Results 1 to 20 of 22
23 Feb 2014, 9:51 PM
#1
janosik1 avatar

janosik1

New Zenner

Join Date:
Feb 2014
Location:
USA
Posts:
8
Plugin Contributions:
0

USPS module suddenly not giving correct insurance rates?

Zen cart 1.5.0

I'm having trouble getting correct insurance rates using the latest USPS shipping module.
Insurance does not gets up to the value of the goods. Only the following basic $ 2.10.
For product value $ 60 add $ 2.10 and for goods value $ 600 also adds $ 2.10

Please help solve this problem.

Thank you very much.

24 Feb 2014, 1:40 AM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: USPS module suddenly not giving correct insurance rates?

I am waiting on an answer from USPS about a question that I have on this before I post the final solution for testing ...

You do win a prize for being the first person to ever notice that the Insurance was not coming back with correct results ... :cheers:

And your prize is ...

I will get this fixed asap!

But before I try various solutions ... I see other issues that the solution will fix that need addressing but USPS has got to provide some better information than what I have found in 100s and 100s of docs ...

If they do not respond early tomorrow, I will post a quickie fix for this for you prior to posting a better solution once I have more information from USPS ...

Let me just say I am not amused at the moment with what I am coming across in trying to come up with the one solution for all fix to this problem ... but, never fear! I will come up with something livable for everyone ... I think ... :lookaroun

NOTE: your example was perfect to really make this problem stand out ... it is amazing no one has said anything about this before now ...

24 Feb 2014, 3:48 PM
#3
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: USPS module suddenly not giving correct insurance rates?

I have not yet heard back from USPS so I am going to give you a temporary fix for the insurance ...

On the file:
/includes/modules/shipping/usps.php

around line 891 add the code in RED:

        else
        {
          continue;
        }

[B]$specialservices =
  '<SpecialServices>' .
    '  <SpecialService>1</SpecialService>' .
  '</SpecialServices>';

[/B]//echo 'USPS $requested_type: ' . $requested_type . ' $service: ' . $service . ' $Container: ' . $Container . '<br>';
        $request .=  '<Package ID="' . $package_count . '">' .

then further down in the code around line 908, add the code in RED:

                 '<Value>' . number_format($order->info['subtotal'] > 0 ? $order->info['subtotal'] + $order->info['tax'] : $_SESSION['cart']->total, 2, '.', '') . '</Value>' .
[B]$specialservices .
[/B]                     '<Machinable>' . ($this->machinable == 'True' ? 'TRUE' : 'FALSE') . '</Machinable>' .

Only check the checkbox for Insurance in the:
Extra Services (Domestic)

Now, test out the $60 and $600 shipping like you did before ...

NOTE: This is NOT a final solution, it is just a temporary work around for you, until USPS gets back to me with the right information ...

24 Feb 2014, 4:15 PM
#4
janosik1 avatar

janosik1

New Zenner

Join Date:
Feb 2014
Location:
USA
Posts:
8
Plugin Contributions:
0

Re: USPS module suddenly not giving correct insurance rates?

Thank you very much for your prompt response. I'll be testing tonight.

Thank you!

25 Feb 2014, 1:30 AM
#5
janosik1 avatar

janosik1

New Zenner

Join Date:
Feb 2014
Location:
USA
Posts:
8
Plugin Contributions:
0

Re: USPS module suddenly not giving correct insurance rates?

Hello,

Thank you for the code.

Just now I finished the test. Packages weighing 1 pound or larger are calculated properly with Priority Mail Parcel.
Packages less like 1 pound I have two options for Priority Mail Parcel and First-Class Mail Parcel. With Priority Mail Parcel is calculated properly. First-Class Mail Parcel gives me the incorrect price. But on my favor.
I'm very happy with that.

Thank you very much.

25 Feb 2014, 2:52 AM
#6
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: USPS module suddenly not giving correct insurance rates?

What is the:
Ship From
Ship To
Weight
Value

that you are testing?

25 Feb 2014, 5:00 PM
#7
janosik1 avatar

janosik1

New Zenner

Join Date:
Feb 2014
Location:
USA
Posts:
8
Plugin Contributions:
0

Re: USPS module suddenly not giving correct insurance rates?

Hello ,

Below is given a list of a test.

Test 1
From ZIP Code 07407 to ZIP Code 11801

A large pack of 8 lbs. Value $ 688.00

Zen Cart.

Priority Mail Parcel - $ 21.45

United State Postal Service .

Priority Mail Parcel - $ 21.45

Small pack 3 oz . value of $ 36.0

Zen Cart .

First -Class Mail Parcel - $ 5.45
Priority Mail - $ 5.60

United States Postal Service .

First -Class Mail Parcel - $ 4.42
Priority Mail - $ 5.60

Test 2
From ZIP Code 07407 to ZIP Code 40216

A large pack of 8 lbs. Value $ 688.00

Zen Cart .

Standard Parcel Post - $ 25.82
Priority Mail Parcel - $ 31.75

United States Postal Service .

Standard Parcel Post - $ 25.82
Priority Mail Parcel - $ 31.75

Small pack 3 oz . Value $ 36.00

Zen Cart .

First - Class Mail Parcel - $ 5.47
Priority Mail - $ 6.00
Standard Parcel Post - $ 7.97

United States Postal Service .

First - Class Mail Parcel - $ 4.42
Priority Mail - $ 6.00
Standard Parcel Post - $ 7.97

It looks like the problem is only with First - Class Mail Parcel .

Thank you for your help.:smile:

25 Feb 2014, 8:57 PM
#8
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: USPS module suddenly not giving correct insurance rates?

3oz $36.00 from 07407 to 11801 with insurance on I am getting:

United States Postal Service (1 Boxes) (0 lbs, 3 oz) (First-Class Mail Letter (2 - 5 days)) |
$3.22 |

     United States Postal Service (1 Boxes)  (0 lbs, 3 oz) (First-Class Mail Large Envelope (2 - 5 days)) | 
     $4.42 | 
     United States Postal Service (1 Boxes)  (0 lbs, 3 oz) (First-Class Mail Parcel (2 - 5 days)) | 
     $4.42 | 

United States Postal Service (1 Boxes) (0 lbs, 3 oz) (Priority Mail™ (1-day)) |
$5.60 |

      | 

3oz $36.00 from 07407 to 40216 I get:

United States Postal Service (1 Boxes) (0 lbs, 3 oz) (First-Class Mail Letter (2 - 5 days)) |
$3.22 |

     United States Postal Service (1 Boxes)  (0 lbs, 3 oz) (First-Class Mail Large Envelope (2 - 5 days)) | 
     $4.42 | 
     United States Postal Service (1 Boxes)  (0 lbs, 3 oz) (First-Class Mail Parcel (2 - 5 days)) | 
     $4.42 | 

United States Postal Service (1 Boxes) (0 lbs, 3 oz) (Priority Mail™ (2-day)) |
$6.00 |

     United States Postal Service (1 Boxes)  (0 lbs, 3 oz) (Standard Post® (4 - 7 days)) | 
     $7.97 | 

Perhaps you can check the 3oz $36.00 ones again just to be sure ...

Should you have something other than the correct rates come up, could you please turn on the Debug to Log in the USPS shipping module and then try them again and Zip the Shipping log files and attach them to your post?

25 Feb 2014, 11:06 PM
#9
janosik1 avatar

janosik1

New Zenner

Join Date:
Feb 2014
Location:
USA
Posts:
8
Plugin Contributions:
0

Re: USPS module suddenly not giving correct insurance rates?

Hello,

I tested again and I got the same result.

In an attachment is usps_logs. zip file

Thank you for your help.:smile:

25 Feb 2014, 11:36 PM
#10
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: USPS module suddenly not giving correct insurance rates?

Could you also Zip the file, from your server, for:
/includes/modules/shipping/usps.php

25 Feb 2014, 11:44 PM
#11
janosik1 avatar

janosik1

New Zenner

Join Date:
Feb 2014
Location:
USA
Posts:
8
Plugin Contributions:
0

Re: USPS module suddenly not giving correct insurance rates?

In an attachment is usps.zip file

Thank you for your help.:smile:

26 Feb 2014, 1:53 AM
#12
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: USPS module suddenly not giving correct insurance rates?

What happens if you UNCHECK the extra Domestic charge for:
USPS Tracking

so it is not added in?

26 Feb 2014, 3:54 PM
#13
janosik1 avatar

janosik1

New Zenner

Join Date:
Feb 2014
Location:
USA
Posts:
8
Plugin Contributions:
0

Re: USPS module suddenly not giving correct insurance rates?

Wow, I unchecked the extra charge for Domestic USPS Tracking and got the right price. I see the fee for USPS Tracking is only for First-Class Mail Parcel.
Now USPS module works very well.

Thank you very much for your help.:smile:

26 Feb 2014, 4:51 PM
#14
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: USPS module suddenly not giving correct insurance rates?

Thanks for the update that setting the right Extra Services to be charged is now giving you just the Insurance added to the shipping costs ... :smile:

13 Mar 2014, 6:39 PM
#15
joeminer81 avatar

joeminer81

New Zenner

Join Date:
Jan 2013
Posts:
16
Plugin Contributions:
0

Re: USPS module suddenly not giving correct insurance rates?

Is this still an issue with the new March 7, 2014 K3 update or was it corrected? I have a cart that is not calculating insurance for an international shipment. I have not done any other testing at this point. Thanks!

13 Mar 2014, 6:58 PM
#16
joeminer81 avatar

joeminer81

New Zenner

Join Date:
Jan 2013
Posts:
16
Plugin Contributions:
0

Re: USPS module suddenly not giving correct insurance rates?

Here is an update on my current issue: Using Priority Mail International vs Priority Mail Express International
Cart is $1137 Priority Mail Intl only allows insurance on up to $675- Cart is not adding any insurance amount or complaining that the cart is over the limit.
Same cart with Priority Mail Express Intl which allows the additional cart value is only adding the minimal insurance cost of $2.35 instead of the using the cart value to calculate the appropriate insurance cost, in this case $5.35.
Customer is in Canada.
No other additional services are being used.

13 Mar 2014, 10:00 PM
#17
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: USPS module suddenly not giving correct insurance rates?

I am checking with USPS as to why they are not giving the correct responses on International ...

I have a suspicion on what is happening, but let me get this confirmed from them before I post a solution, as my possible solution is not how the docs read ...

17 Mar 2014, 7:35 PM
#18
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: USPS module suddenly not giving correct insurance rates?

I have still not gotten a response from USPS for this, so as a temporary fix, try commenting out the code with the comment marks in RED:

$extraservices =
'<ExtraServices>' .
[B]//[/B]  '  <ExtraService>0</ExtraService>' .
 '  <ExtraService>1</ExtraService>' .
[B]//[/B]  '  <ExtraService>2</ExtraService>' .
[B]//[/B]   '  <ExtraService>3</ExtraService>' .
[B]//[/B]   '  <ExtraService>5</ExtraService>' .
[B]//[/B]   '  <ExtraService>6</ExtraService>' .
//  '  <ExtraService>9</ExtraService>' . breaks USPS when used with other ExtraServices
'</ExtraServices>';

Do not check any of the Extra Services (International) except the Insurance ...

18 Mar 2014, 6:40 AM
#19
joeminer81 avatar

joeminer81

New Zenner

Join Date:
Jan 2013
Posts:
16
Plugin Contributions:
0

Re: USPS module suddenly not giving correct insurance rates?

The last modification does correct the problem of Priority Mail Express Intl not calculating the correct insurance charge.
However, the problem with Priority Mail (Not Express) Intl not adding any insurance up to the maximum amount allowed ($675 for this example) or complaining that the cart is over the limit still exists.

Thank you for your help in this matter.

18 Mar 2014, 1:22 PM
#20
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: USPS module suddenly not giving correct insurance rates?

If I try 13lbs $325 to Canada, I get:

United States Postal Service (1 Boxes) (13 lbs, 0 oz) (Priority Mail International® Medium Flat Rate Box (6 - 10 business days to many major markets) $hiddenCost: 7.05) |
$49.30 |

     United States Postal Service (1 Boxes)  (13 lbs, 0  oz) (Priority Mail International® Large Flat Rate Box (6 - 10 business  days to many major markets) $hiddenCost: 7.05) | 
     $62.80 | 
     United States Postal Service (1 Boxes)  (13 lbs, 0  oz) (Priority Mail International® (6 - 10 business days to many major  markets) $hiddenCost: 7.05) | 
     $65.60 | 
     United States Postal Service (1 Boxes)  (13 lbs, 0  oz) (Priority Mail Express International™ Flat Rate Boxes (3 - 5  business days to many major markets) $hiddenCost: 2.35) | 
     $69.30 | 
     United States Postal Service (1 Boxes)  (13 lbs, 0  oz) (Priority Mail Express International™ (3 - 5 business days to many  major markets) $hiddenCost: 2.35) | 
     $91.20 | 
     United States Postal Service (1 Boxes)  (13 lbs, 0  oz) (Global Express Guaranteed® (GXG) (1 - 3 business days to many major  markets) $hiddenCost: 3) | 
     $114.75 | 
     United States Postal Service (1 Boxes)  (13 lbs, 0 oz) (USPS  GXG™ Envelopes (1 - 3 business days to many major markets) $hiddenCost:  3) | 
     $114.75 | 

If I do 26lbs $650 to Canada I get:

United States Postal Service (1 Boxes) (26 lbs, 0 oz) (Priority Mail International® (6 - 10 business days to many major markets) $hiddenCost: 10.5) $102.20
United States Postal Service (1 Boxes) (26 lbs, 0 oz) (Priority Mail Express International™ (3 - 5 business days to many major markets) $hiddenCost: 3.85) $147.95
United States Postal Service (1 Boxes) (26 lbs, 0 oz) (Global Express Guaranteed® (GXG) (1 - 3 business days to many major markets) $hiddenCost: 6) $173.00
United States Postal Service (1 Boxes) (26 lbs, 0 oz) (USPS GXG™ Envelopes (1 - 3 business days to many major markets) $hiddenCost: 6) $173.00

However, on the USPS site, it says for Priority Mail International it will not add insurance over value of $675 ...

The $hiddenCost on these examples is showing how much is added by the Insurance ...

Are you wanting the $675 "portion" of the cart to be insured of the $1137?