shokokoo wrote:I managed to figure that one out and changed my package sizes. Now this is working fine for all US shipping addresses, once I select an address outside the US it generates the following error
USPS Error returned: Error Desc: One or more package dimensions are invalid.USPS Help Context: 1000440.
I played arround with package sizes and still got the same error. Any suggestions??? Thanks
That error occurs for an USPS international rate request when the dimensions are too large (international rate request doesn't use package size) and is caused by the way nopCommerce determines dimensions (explained in previous post). You can avoid the error by commenting out the GXG (Global Express Guaranteed) section of the international rate request. The GXG section is optional and omitting it may affect (size specific) rates (but the available dimensions are wrong anyway, so they may as well be removed).
GXG Size RestrictionsIndividual dimensions not to exceed:
Length = 46 inches
Width = 35 inches
Height = 46 inches---
Edit file: Shipping\Nop.Shipping.USPS\USPSComputationMethod.cs
Remove or comment out the following code (or replace length, width, and height with a hard-coded value e.g. "10"):
//sb.Append("<GXG>");
//sb.AppendFormat("<Length>{0}</Length>", length);
//sb.AppendFormat("<Width>{0}</Width>", width);
//sb.AppendFormat("<Height>{0}</Height>", height);
//sb.Append("<POBoxFlag>N</POBoxFlag>");
//sb.Append("<GiftFlag>N</GiftFlag>");
//sb.Append("</GXG>");
and the following code (located below the above code in the else statement, executed when the package is too large)
//sb.Append("<GXG>");
//sb.AppendFormat("<Length>{0}</Length>", length2);
//sb.AppendFormat("<Width>{0}</Width>", width2);
//sb.AppendFormat("<Height>{0}</Height>", height2);
//sb.Append("<POBoxFlag>N</POBoxFlag>");
//sb.Append("<GiftFlag>N</GiftFlag>");
//sb.Append("</GXG>");
Rebuild the project after changing the code.
There doesn't seem to be a way to limit the international USPS shipping services via the request. You could probably filter them in the response though.
.