USPS Maximum size issue

  • Posts: 7
  • Thank you received: 1
10 years 10 months ago #138749

-- HikaShop version -- : 2.2.3 business
-- Joomla version -- : 2.5.16

I have a problem with the maximum size allowed by the USPS plugin. For USPS this is calculated at (Max length + Girth) = 108in (or 130in for Parcel Post or Standard Mail). So in general, L + (2*W + 2*H) must be less than 130in, where L is the longest dimension. The only option I have is to set a maximum volume in the plugin, which doesn't equate very well for large parcels of multiple sizes. (Some are square, some are long and flat.)

Is there a way to add this into the USPS plugin? (Seems not too difficult, but I'm not a PHP programmer.)

Edit: Unless I'm reading it all wrong (not strong on PHP etc.), this appears to be broken because the plugin does not pass the actual dimensions to the USPS server. Instead, there appear to be fixed values in usps.php. For US requests it appears to pass just the <size> parameter as 'REGULAR, when it seems width, length and height are optional values that could be passed to the API as shown in www.usps.com/business/web-tools-apis/rat...7a.htm#_Toc328498434

$parcel->Length=15;
$parcel->Width=15;
$parcel->Height=15;

How can I fix this?

Last edit: 10 years 10 months ago by brianbt. Reason: More info added

Please Log in or Create an account to join the conversation.

  • Posts: 7
  • Thank you received: 1
10 years 10 months ago #138841

Anyone?

Please Log in or Create an account to join the conversation.

  • Posts: 12953
  • Thank you received: 1778
10 years 10 months ago #138930

Hi,
The USPS shipping module wasn't developed by us, but we already and still correct some parts of this plugin through every release, Also note that the this plugin will only send to the USPS server the weight of your products.
Regarding your maximum size issue I'll probably be able to give the code that you need to set a maximum size, but can you tell me exactly what will be the maximum size of each USPS service that you'll be able to find through your USPS shipping configuration page : "Hikashop->System->Shipping methods->USPS".

Please Log in or Create an account to join the conversation.

  • Posts: 7
  • Thank you received: 1
10 years 10 months ago #138997

We use First Class mail and Parcel Post. The heaviest weight for First Class is only 13oz so I'm not concerned about that one as they won't return a price for First Class for a large heavy parcel. For Parcel Post, they calculate it by Length plus Girth. It must be <=130in. (All our measurements are entered in inches.) We use only domestic shipping through USPS, no International rates.

The Length is the longest side, and the girth is 2xW + 2xH, so their maximum size is L+(2W+2H) <=130 We can make sure the length value is always entered as the longest side if that makes it easier.

(If we can send them the length, width, and height and/or girth of a package in the API request it seems that they can work with that and it won't need a separate calculation?)

Last edit: 10 years 10 months ago by brianbt.

Please Log in or Create an account to join the conversation.

  • Posts: 12953
  • Thank you received: 1778
10 years 10 months ago #139210

Hi,
I just done some changes through the code of the USPS shipping method and now it directly send the dimensions of your products to the USPS server. Can you test it and tell me if it solve your issue ?
Note that I have set the girth of your USPS packages like this : ((height + widht)*2) + lenght

Attachments:
Last edit: 10 years 10 months ago by Mohamed Thelji.

Please Log in or Create an account to join the conversation.

  • Posts: 7
  • Thank you received: 1
10 years 10 months ago #139261

Not quite, but I have worked with it a little to get it working. It needs some adjustments to the other attributes when the dimensions are included. I will post what I have when I have made a few more refinements. Thank you.

Please Log in or Create an account to join the conversation.

  • Posts: 7
  • Thank you received: 1
10 years 10 months ago #139303

Girth is just 2(W+H)
I modified it some, and it now works okay for single items (but please check that my syntax/php is okay...)

The maximum dimension L+(2(W+H)) for Parcel/Standard post is 130in. For all other mail it is 108in, so I added that. It also needs <Container> set to LARGE if any side is more than 12in.

The big problem now is that it does not calculate the overall parcel size correctly if there is more than one item. For example, if I order 2 items which are 12x12x12 it calculates a package size of 24x24x24! This makes a 40lb parcel cost go from about $20 to about $62.

(By the way, in their documentation they sometimes mention 'Standard Post'. This is the same as Parcel Post, just a new name.)

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 12953
  • Thank you received: 1778
10 years 10 months ago #139656

Ok,
I just checked your code and as you said, the best solution will probably be to let USPS check our packages dimensions/girth, so can you give me a link to the USPS documentation (if it's the last USPS developer documentation) or directly send it to me through :
'mohamed AT hikashop DOT com'

Last edit: 10 years 10 months ago by Mohamed Thelji.

Please Log in or Create an account to join the conversation.

  • Posts: 7
  • Thank you received: 1
10 years 10 months ago #139695

Their latest guide is at www.usps.com/business/web-tools-apis/Rate-Calculators-v1-8a.htm

I would be happy to help with testing; please let me know. One note: it's best to use their production server for development. Their test server does not always provide the same response and sometimes rejects valid calls that the production server accepts.

(Thanks for looking into this. USPS is very important to US customers. It's the only service that delivers to every US address!)

The following user(s) said Thank You: Mohamed Thelji

Please Log in or Create an account to join the conversation.

  • Posts: 12953
  • Thank you received: 1778
10 years 8 months ago #147083

Hi,
Thanks for your feedback, and note that we'll probably start the USPS development next week, so your link to the USPS documentation will be useful :).

Please Log in or Create an account to join the conversation.

Time to create page: 0.084 seconds
Powered by Kunena Forum