The Foxy forums are on the move!

We're in the process of moving our forums over to a new system, and so these forums are now read-only.
If you have a question about your store in the meantime, please don't hesitate to reach out to us via email.

Issue with weights rounding down

On my store I have some tiny objects, with weight 0.001 pounds. This is a reasonable weight estimate-- 1000 will weigh one pound. Someone may wish to buy one of these, or 50,000 of them. While we don't make much if any money on a sale of one such item, people who sample them sometimes come back to buy large quantities.

Now, if someone adds one of these to their cart and goes to checkout, we get an error, perhaps like: "UPS Error: Packages must weigh more than zero pounds. USPS Error: Unable to calculate international postage. No services available. Unable to calculate international postage"

My error log is full of error messages like these. Not only we do we lose the sale, but it does not reflect well on our store.

It seems as though shipping weights are rounded down to zero if the total shipping weight is less that 0.005 pounds.

How can I fix this? Ideally, we would round up the total weight of an order up to 0.005 if it is greater than zero and less than 0.005.

I don't think that it can be fixed by custom shipping logic, because that occurs after carrier rates are returned.

I can't round the weight of the individual objects up to 0.005 lb, because then the weight for 50,000 reads as 250 lb, not 50 lb. It's not accurate or reasonable.

Is there something that FoxyCart can do about this?

  • fc_adamfc_adam FoxyCart Team

    Thanks for the detailed overview, and I'm sorry for the issue here. Digging into this for your store, I can see what you're describing, where a very low weight order is causing the rates to try to calculate with zero weight.

    This does look to relate to some code in our shipping calculations that is rounding the shipping weight to two decimal places, which for a 0.001 weight will become 0. We'll work on a fix there to prevent it from making it to UPS as zero, and follow-up when completed.

    In the meantime, you could prevent this from completely stopping orders by adding a fallback rate to your custom shipping code. This would be a rate that would only be displayed if no other rate was returned from the carriers or custom code. That could look as simple as this, which would add a $3.50 "Standard Shipping" rate:
    if (!rates.exists()) {
    rates.add(10001, 3.5, '', 'Standard Shipping');
    You could expand on that to make it more complex if you'd prefer too.
  • fc_adamfc_adam FoxyCart Team

    Quick update - we've just rolled out a fix for this - you should see rates returning now even when you specify item weight to three decimal places. Sorry for the inconvenience this caused for you and your customers,
  • Fantastic; thank you!
Sign In or Register to comment.