Subscription weights suddenly changed to 6.1 lbs?

I think I found a really weird bug - when shipping out a customer order today, we saw that its weight came into our shipping system as 6.1 lbs, when the product we were shipping weighs something like 2 oz. We've never shipped a customer order over 1 lb, actually.

It turns out that this was a subscription order - so I went into the Foxycart subscriber XML, and sure enough, the product weight there was listed as 6.1 lbs. This was the case for quite a few subscribers.

Here's the thing: All of these subscribers had received previous packages in their subscription... with the correct weight coming to our shipping system (something on the order of half a pound for each of them). I'm certain that when these subscriptions first processed, they did so with the correct weight. For a sanity check, I looked at our website code, and sure enough:

if ((0.1438*(totalhand + totalfoot) + 0.2375) < 0.99) {
document.getElementById("formweight").value = (0.1438*(totalhand + totalfoot) + 0.2375).toFixed(4).toString();
} else {
document.getElementById("formweight").value = "0.99";
}


...we don't even allow a weight to post in the Foxycart form over 1 lb! The only conclusion, as crazy as it sounds, is that at some point, these weights (the exact FC parameter is "product_weight") were changed in the FC subscription system. It seems to be a FC-side error.

This doesn't break our site or anything, but it's annoying. I want to get to the bottom of what's happening, and am happy to help debug it in any way you guys would like.
Comments
  • fc_adamfc_adam FoxyCart Team
    edited December 3
    @Kasper,

    That does sound very strange and annoying! Reviewing subscriptions for your store, I see a number of subscriptions with weights over 1 pound. 4 at 6.1 lbs, 2 at 15.9 lbs and one at 10.7 lbs. Reviewing our logs for those transactions, it's showing that when the product was added to the cart, it was indeed added with that weight.

    The logic you posted above should indeed ensure the weight is set to a maximum of 0.99lb though. Is there any add to carts where that javascript isn't run? Or is there a chance that the javascript wasn't run, and those weights were what the weight field was set to by default?

    If you wanted to update each of those subscriptions to have the maximum 0.99 lb weight for all future renewals, you can do that from the "subscriptions" section of the administration. For each subscription, click the "Edit" button, and on the edit screen, click the "Advanced Edit' button. In the textarea that appears, look for the following line that sets the product weight:
    <product_weight><![CDATA[6.1]]></product_weight>
    Within that line, you can update the number to what you want it to be and update the subscription to save the change.
  • Thank you, Adam. I'm going to go ahead and manually fix all the subscriptions - we'll see if this issue pops up again and we can take it from there.
  • fc_adamfc_adam FoxyCart Team
    edited December 5
    @Kasper,

    Awesome. If you do see a new subscription come in with the wrong rate - let us know and we can take a look in our logs to see where that product was added from. That might help find out where that increased weight is coming from. Unfortunately the ones already in your store are a bit too far back for us to easily see in our logs.
Sign In or Register to comment.