Narrowing Down USPS shipping methods in 1.5

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
Hace 14 años
Can anyone please help or guide me as where to go to narrow down the USPS shipping methods in  version 1.5

Thanks inadvance for any replies
Hace 14 años
shokokoo wrote:
Can anyone please help or guide me as where to go to narrow down the USPS shipping methods in  version 1.5

Thanks inadvance for any replies


The following post is for version 1.40, but it should work for 1.50: https://www.nopcommerce.com/boards/topic.aspx?topicid=2556#12581. You will need nopCommerce 1.50 with source code (http://www.nopdownloads.com/downloads/nopCommerce_1.50.rar) and you will have to recompile the USPS project.

.
Hace 14 años
Thanks for the reply. I see the source code and where I need to make the changes. I'm in no means a coder and would appreciate the help on how to recompile the project.
Hace 14 años
shokokoo wrote:
Thanks for the reply. I see the source code and where I need to make the changes. I'm in no means a coder and would appreciate the help on how to recompile the project.

Rather than explaining how to compile the solution, I have a modified USPS shipping rate computation method (Nop.Shipping.USPS.dll) available for NopCommerce 1.50 that only provides rates for Express, Priority, and Parcel Post.

Download modified Nop.Shipping.USPS.dll. Or download as a zip with modified Nop.Shipping.USPS.dll named Nop.Shipping.USPS.dll.new (remove the .new extension before copying to bin/).

To use the modified USPS shipping rate computation method:
1. Ensure your existing USPS shipping rate computation method is configured (USPS username and password and production URL entered in administration and that it is active) and go through the checkout with an item (make sure it has a value for weight) until you get to "Select Shipping Method" showing (fifteen?) USPS shipping services -leave the browser open to verify the change in step 4.
2. In the bin/ folder, rename the existing file Nop.Shipping.USPS.dll to Nop.Shipping.USPS.dll.old (in case you need to revert).
3. Copy the new Nop.Shipping.USPS.dll file to the bin/ folder.
4. To verify the change, refresh the shopping cart page (from step 1) and the USPS shipping services should change to Express, Priority, and Parcel Post.

If you need to revert back to the original dll, in the bin/ folder, delete (or rename) Nop.Shipping.USPS.dll and rename Nop.Shipping.USPS.dll.old to Nop.Shipping.USPS.dll.

This was tested on a default install of nopCommerce 1.50.

.
Hace 14 años
Thanks for the file.

It works great when I have a small order, but larger orders get a error like this:

USPS Error returned: Error Desc: Invalid container type. Valid container types for Priority Mail are Flat Rate Envelope, Sm Flat Rate Box, Md Flat Rate Box and Lg Flat Rate Box.USPS Help Context: 1000440. Error Desc: Invalid container type. Valid container types for Priority Mail are Flat Rate Envelope, Sm Flat Rate Box, Md Flat Rate Box and Lg Flat Rate Box.USPS Help Context: 1000440. Error Desc: Invalid container type. Valid container types for Priority Mail are Flat Rate Envelope, Sm Flat Rate Box, Md Flat Rate Box and Lg Flat Rate Box.USPS Help Context: 1000440.
Hace 14 años
Thanks mb,
This is exactly what I need. I will try it and let you know how it goes. Thanks again
Hace 14 años
Well I tried the file and it works fine on small orders. When the order weight is > 2lbs. it gives the error mentioned above. I figured out how to compile the the source code as suggested and my shipping options are Express, Priorty and Media mail. it also works fine if the total weight is 10lbs. or less and than it gives the same errors. here is my dll file if someone needs to use it. file, zipped version
Hace 14 años
NewYorkWedge wrote:
Thanks for the file.

It works great when I have a small order, but larger orders get a error like this:

USPS Error returned: Error Desc: Invalid container type. Valid container types for Priority Mail are Flat Rate Envelope, Sm Flat Rate Box, Md Flat Rate Box and Lg Flat Rate Box.USPS Help Context: 1000440. Error Desc: Invalid container type. Valid container types for Priority Mail are Flat Rate Envelope, Sm Flat Rate Box, Md Flat Rate Box and Lg Flat Rate Box.USPS Help Context: 1000440. Error Desc: Invalid container type. Valid container types for Priority Mail are Flat Rate Envelope, Sm Flat Rate Box, Md Flat Rate Box and Lg Flat Rate Box.USPS Help Context: 1000440.


shokokoo wrote:
Well I tried the file and it works fine on small orders. When the order weight is > 2lbs. it gives the error mentioned above. I figured out how to compile the the source code as suggested and my shipping options are Express, Priorty and Media mail. it also works fine if the total weight is 10lbs. or less and than it gives the same errors. here is my dll file if someone needs to use it. file, zipped version


The problem stems from the way nopCommerce determines the shipping package size (it sums all the cart items' heights, widths, and lengths and uses the respective summed values to determine the package size) which results in the package size being set too large. When specifying shipping service Priority, with a LARGE package size, a Container value is required along with the package dimensions. When you use ALL with a LARGE package size, you'll notice that Priority rates are omitted in the response.

You can stick with using ALL or try to workaround the problem. The easiest workaround is to skip the Priority service if the package size is not Regular when forming the rate request; you will then be left with Express or Parcel Post for the customer to choose. Or hard-code the package size to REGULAR (so container and dimensions are optional).

.
Hace 14 años
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
Hace 14 años
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 Restrictions
Individual 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.

.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.