Support » Plugin: WooCommerce Shipping & Tax » No longer picking correct box

  • Resolved klishb


    For months the box being selected for 2 of products was the medium flat rate top loading box. Without changing the product dimensions it’s now selecting a large flat rate box for the exact same 2 products. I know the two items will fit in a medium flat rate box as they always have so I end up having to refund the customer the difference. Any suggestions appreciated.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter klishb


    If this is the way it calculates box packing then I don’t see why it’s picking the large flat rate box now.

    The medium flat rate top loading box should be a volume of 514.25 (11 x 8.5 x 5.5 in)
    The volume of my two products is only 438.048 (5.2 x 5.2 x 8.1 in)

    When I turn on debugging that is the value returned by the USPS API for the medium flat rate box (I tested with a different product). Also, my product dimensions are shown on the cart page with debugging on. I can therefore confirm the correct values are being used, but it’s still not picking the correct box.

    Plugin Contributor Marcin


    Hi @klishb,

    We introduced a new geometry-based algorithm for box packing about a year ago. Rather than calculating the overall volume, we try to rotate and combine the items so they fit into the provided boxes. In general, this approach proved to be more accurate than the volume-based calculations.

    However, in this case, your items should fit into a Medium Flat Rate box, so this seems to be a bug. I put the issue on our radar and we are going to address it.

    Thank you for reporting this!

    Thread Starter klishb


    Hi Marcin,

    Thank you for your response. I guess for now I’m going to try making the dimensions smaller to work around the problem.

    Interesting that you went with a geometry-based approach. This is for my dad’s website and for him he’s only selling Maple Syrup bottles so the geometry is a bit strange. Is the new algorithm calculating off the assumption the products are a rectangle?

    Plugin Contributor Marcin


    > Is the new algorithm calculating off the assumption the products are a rectangle?

    Yes, the algorithm assumes that the products are rectangular.

    And you’re right, at the moment the best solution would be to experiment with the product dimensions.

    Plugin Support Doug – a11n


    Automattic Happiness Engineer

    Hey there @klishb

    I hope Marcin’s reply has helped you understand the logic a bit more.

    We haven’t heard back from you in a while, so I’m going to mark this as resolved – if you have any further questions, you can start a new thread.


    I am also having this problem with my website, A week ago, it was selecting a small flat rate box when a customer had 4 bars of soap in the cart. Now suddenly, the API selects a medium flat rate box for 4 bars of soap. I know for a fact that 4 bars of soap fit in a small flat rate box, with room for padding. The items are rectangular, so the fact that the API works with rectangles is not the issue. I adjusted the height of each product to less than an inch so it forces the API to select the small flat rate box. However, I don’t like that the dimensions displayed on the website are not true to size. I don’t want the customer to think the bars are smaller than they actually are. It seems like the API was working better last week. Did something change?

    I cannot get mailing tubes to show up. The art prints are 24×16. The mailing tube is 24×3. I crated a custom package, “First-Class Mail USPS 24″ x 3 Tube.” Do I need to go to 26×3 mailing tubes to trick this new algorithm into working? Incidentally, every now and then I see Priority Mail tubes pop up as an option, but I’d rather use First Class for Intl. I hope that’s not asking too much. Thank in advance for your reply.

    Thread Starter klishb


    Is it just me or is this a completely different problem? Seems like it should be in a new thread.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘No longer picking correct box’ is closed to new replies.