Zen Cart Logo
Forums / Addon Shipping Modules / mods to USPS RateV4 Intl RateV2

mods to USPS RateV4 Intl RateV2

Views: 1,863

Results 1 to 14 of 14
27 Mar 2014, 9:13 PM
#1
kehrli avatar

kehrli

Zen Follower

Join Date:
Aug 2007
Location:
Cannon Beach, OR
Posts:
180
Plugin Contributions:
0

mods to USPS RateV4 Intl RateV2

Ajeh, I hope you're listening.

Back in Jan 13 you made a mod for me to the extant usps.php so that the module would show pricing for weights larger than the USPS maximum weights. At that time it seemed like you wanted to add the code to the next update, so I didn't worry about it.

I've finally been forced to update the module because I can no longer get proper rates with my Jan 28,13 version of the module. But I've lost the functionality of the mods you did for me. I've attached the modded file below. If you could sort of tell me the functions that are modded, I'm sure I can hobsom jobsom them into the current module - and do so in future updates. But I scanned the file, and couldn't find the mods in there.

Can you help me with this without re-doing the whole thing?

27 Mar 2014, 10:39 PM
#2
ajeh avatar

ajeh

Oba-san

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

Re: mods to USPS RateV4 Intl RateV2

I am not seeing the customization ...

What were the changes suppose to do for you?

Are you sure this was the customized USPS J5 that you were using?

27 Mar 2014, 10:57 PM
#3
ajeh avatar

ajeh

Oba-san

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

Re: mods to USPS RateV4 Intl RateV2

If you can post the settings you have been using on Configuration ... Shipping/Packaging ...

And the Product Price?

And Product Weight?

And Product Quantity being tested?

I am starting to recall the customizations but it would help if you can remind me of these settings and what your expected results on the quotes are when shipping to Egypt ...

Also, the Ship To address, are you using:
123 Somewhere
Nasr City, 11371
Cairo, Egypt

28 Mar 2014, 12:11 AM
#4
kehrli avatar

kehrli

Zen Follower

Join Date:
Aug 2007
Location:
Cannon Beach, OR
Posts:
180
Plugin Contributions:
0

Re: mods to USPS RateV4 Intl RateV2

Good memory!

The simplicity is that I wanted the USPS Mod to give me shipping prices even though the weight of the order (even if only one line item) was too high for USPS Shipping. We would then split the order into smaller segments which are less than 66 lbs (I believe that's the max).

You modded the usps.php to allow for any size shipment. If the order is 200 lbs, with the mod, it will show the USPS shipping options calculated for 3 packages of 66.6 lbs each - or some such device.

I was probably shipping to Egypt at that time, but it's not a specific country that needs to be handled. I have customers in 96 countries, so need the functionality for both domestic and international shipping.

I've re-attached the code here to be sure I gave you the correct module. I just tested this code on a different web site and it's working for 400 pound USPS shipments for US and for China (oddly Egypt didn't work - but the module is very old now). It's different by a few days than the module I attached in the last post. I used winmerge and found it to be identical with with the 7/30/13 release of the module from the ZenCart website: @version $Id: usps.php 2013-07-30 ajeh Version J5. But it's working with large orders. So, I'm a little confused - did you add the functionality to the release?

I've attached one other file that I think I got from you at the time you did the mods. It's also attached in the hopes that it will make things clearer and easier. I think you labeled it with the mods in it. Attachment #13920

28 Mar 2014, 12:17 AM
#5
ajeh avatar

ajeh

Oba-san

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

Re: mods to USPS RateV4 Intl RateV2

Could you post the settings I asked for so that we test apples and apples?

28 Mar 2014, 12:53 AM
#6
ajeh avatar

ajeh

Oba-san

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

Re: mods to USPS RateV4 Intl RateV2

Can you try something?

Edit the new USPS March 7, 2013 K3 shipping module and change the code:

// turn off SpecialServices
//$specialservices = '';

to read:

// turn off SpecialServices
$specialservices = '';

Does this fix the Domestic shipping for you?

28 Mar 2014, 7:52 PM
#7
kehrli avatar

kehrli

Zen Follower

Join Date:
Aug 2007
Location:
Cannon Beach, OR
Posts:
180
Plugin Contributions:
0

Re: mods to USPS RateV4 Intl RateV2

Ajeh:

Can you try something?

Edit the new USPS March 7, 2013 K3 shipping module and change the code:

// turn off SpecialServices
//$specialservices = '';

> 
> to read:
> ```
// turn off SpecialServices
$specialservices = '';

Does this fix the Domestic shipping for you?

Yes, that works. It gives Priority Mail, but not Parcel Select. I think this is plenty good though because at large weights, Parcel Select is about the same as Priority Mail.

I also checked international, and I believe you already know, but it still doesn't work.

28 Mar 2014, 7:59 PM
#8
kehrli avatar

kehrli

Zen Follower

Join Date:
Aug 2007
Location:
Cannon Beach, OR
Posts:
180
Plugin Contributions:
0

Re: mods to USPS RateV4 Intl RateV2

Ajeh:

If you can post the settings you have been using on Configuration ... Shipping/Packaging ...

And the Product Price?

And Product Weight?

And Product Quantity being tested?

I am starting to recall the customizations but it would help if you can remind me of these settings and what your expected results on the quotes are when shipping to Egypt ...

Also, the Ship To address, are you using:
123 Somewhere
Nasr City, 11371
Cairo, Egypt

Sorry. Yes, here are the config settings:

United States Postal Service

You will need to have registered an account with USPS at https://secure.shippingapis.com/registration/ to use this module

USPS expects you to use pounds as weight measure for your products. |

USPS Version Date
2014-03-07

Enable USPS Shipping
True

Enter the USPS Web Tools User ID
XXXFUELXXXXX

Which server to use
production

Quote Sort Order
Price-LowToHigh

Handling Fee - US
0

Handling Fee - International
0

Handling Per Order or Per Box
Box

Decimal Settings
3

Tax Class
--none--

Tax Basis
Shipping

Shipping Zone
--none--

Sort Order
30

All Packages are Machinable?
False

USPS Options
Display weight, Display transit time

USPS Domestic Transit Time Calculation Mode
NEW

USPS Domestic minimum Length
8.625

USPS minimum Width
5.375

USPS minimum Height
1.625

USPS International minimum Length
9.50

USPS minimum Width
1.0

USPS minimum Height
5.50

Enable USPS First-Class filter for US shipping
False

Shipping Methods (Domestic and International)
0, .21875, 0.00, 0, .8125, 0.00, First-Class Mail Parcel, 0, .8125, 0.00, 0, 70, 0.00, 0, 70, 0.00, Priority MailTM, 0, 70, 0.00, 0, 70, 0.00, 0, 70, 0.00, 0, 70, 0.00, 0, 70, 0.00, 0, 70, 0.00, 0, 70, 0.00, 0, 15, 0.00, 0, 20, 0.00, 0, 25, 0.00, Priority Mail ExpressTM, 0, 70, 0.00, 0, 70, 0.00, 0, 70, 0.00, 0, 70, 0.00, 0, .21875, 0.00, 0, 4, 0.00, First-Class Package International ServiceTM**, 0, 4, 0.00, Priority Mail InternationalRM, 0, 66, 0.00, 0, 4, 0.00, 0, 4, 0.00, 0, 20, 0.00, 0, 20, 0.00, Priority Mail Express InternationalTM, 0, 66, 0.00, 0, 4, 0.00, 0, 20, 0.00, USPS GXGTM Envelopes**, 0, 70, 0.00, 0, 70, 0.00

Extra Services (Domestic)
Certified MailRM, N, USPS TrackingTM, N, Insurance, N, Priority Mail Express Insurance, N, Adult Signature Restricted Delivery, N, Adult Signature Required, N, Registered without Insurance, N, Registered MailTM, N, Collect on Delivery, N, Return Receipt for Merchandise, N, Return Receipt, N, Certificate of Mailing, N, Signature ConfirmationTM, N, Priority Mail Express 1030 AM Delivery, N

Extra Services (International)
Registered Mail, N, Insurance, N, Return Receipt, N, Electronic USPS Delivery Confirmation International, N, Certificate of Mailing, N

Retail pricing or Online pricing?
Online

Debug Mode
Off |

Various tests were done, but an example is: quantity of items = 3; weight = 264 pounds; total price = $7,197.

Note, in my case even one line item can be broken down into multiple boxes.

28 Mar 2014, 9:35 PM
#9
ajeh avatar

ajeh

Oba-san

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

Re: mods to USPS RateV4 Intl RateV2

Please go to Configuration ... Shipping/Packaging ... and post your settings here ...

Then, edit the Module ... Shipping ... USPS and turn on the Debug to Log ...

Now try your shipping with the:
quantity of items = 3; weight = 264 pounds; total price = $7,197

and try to ship to Egypt ...

In the /logs (this will be /cache in v1.3.9) see what Shipping debug logs are generated for something similar to:
SHIP_usps_Debug_03282014173156_EG_11371_44lb_0oz.log

Zip the newest log for Egypt and attach it to your post ...

29 Mar 2014, 6:38 AM
#10
kehrli avatar

kehrli

Zen Follower

Join Date:
Aug 2007
Location:
Cannon Beach, OR
Posts:
180
Plugin Contributions:
0

Re: mods to USPS RateV4 Intl RateV2

Ajeh:

Please go to Configuration ... Shipping/Packaging ... and post your settings here ...

Then, edit the Module ... Shipping ... USPS and turn on the Debug to Log ...

Now try your shipping with the:
quantity of items = 3; weight = 264 pounds; total price = $7,197

and try to ship to Egypt ...

In the /logs (this will be /cache in v1.3.9) see what Shipping debug logs are generated for something similar to:
SHIP_usps_Debug_03282014173156_EG_11371_44lb_0oz.log

Zip the newest log for Egypt and attach it to your post ...

Now, it's working for Egypt. I wasn't getting any rates when I tested earlier in the day.

The only thing I've changed was un-commenting that one line per your instructions. That's what did it? Will that work for future updates as well?

I'm not sure why it's working now, when it wasn't before. Maybe I'll have to lay off the crack.

I think it's no longer needed but my shipping settings are below. And I've posted the log file. Thanks, Ajeh. I'll do another dono to the ZenCart coffee fund. :)

Shipping/Packaging settings: Country of Origin United States Info Postal Code 97138 Info
Enter the Maximum Package Weight you will ship 70 Info
Package Tare Small to Medium - added percentage:weight 11:.32 Info
Larger packages - added packaging percentage:weight 10:2 Info
Shipping Delay 1 Info
Display Number of Boxes and Weight Status 2 Info
Order Free Shipping 0 Weight Status 0 Info
Shipping Estimator Display Settings for Shopping Cart 1 Info
Display Order Comments on Admin Invoice 1 Info
Display Order Comments on Admin Packing Slip 1

29 Mar 2014, 1:39 PM
#11
ajeh avatar

ajeh

Oba-san

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

Re: mods to USPS RateV4 Intl RateV2

Apparently, USPS is sending back error messages on Domestic over $5000 rather than the portion of the order that they do Insure so setting that:

// turn off SpecialServices
$specialservices = '';

turns off all requests for SpecialServices ...

On International, it does not return Insurance either, but rather than send back an error, they just do not send back the ExtraService request for Insurance ...

I am talking to USPS about how better to address this issue and hope to hear that we can work out better solutions ...

NOTE: Currently, there is some issue since March 7, 2014 where their server is not managing the quotes right and you will get no quotes from USPS ...
If your logs happen to be on, you will see the message:

Mar 28 2014 23:31:49 -- [B]CommErr (should be 0): 56 - Recv failure: Connection reset by peer[/B]

Usually, just trying the get the quote again should fix it for now, while USPS is trying to figure out the cause of this issue ...

Hopefully the next update for USPS will have fixes for these issues built in ...

Thanks for letting us know that this work around has resolved your issues for now ...

29 Mar 2014, 5:34 PM
#12
kehrli avatar

kehrli

Zen Follower

Join Date:
Aug 2007
Location:
Cannon Beach, OR
Posts:
180
Plugin Contributions:
0

Re: mods to USPS RateV4 Intl RateV2

Ty Ajeh. You seem to be the main interface to USPS. You must have infinite patience. Lots of Zen. :)

29 Mar 2014, 5:38 PM
#13
ajeh avatar

ajeh

Oba-san

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

Re: mods to USPS RateV4 Intl RateV2

Some say it helps when you are nuts ... but they gotta catch me first ... :cool:

1 Apr 2014, 3:22 PM
#14
johndmoulton avatar

johndmoulton

New Zenner

Join Date:
Dec 2013
Location:
Texas
Posts:
1
Plugin Contributions:
0

Re: mods to USPS RateV4 Intl RateV2

USPS Short Codes in their Module: This may be the simplest thing to most, but it just took me nearly an hour to resolve as I'm not a big user of the postal service. Given this I was struggling with what was meant by some of the terms in the USPS ZenCart Module and this is what I came up with: 'Pad.' = Padded. 'F/R = Flat Rate. Env. = Envelope. R/R = Regional Rate. Leg. = Legal. GXG = Global Express Guaranteed. Hope this saves someone else the hour. Cheers for now. John.