I'm not sure if you've thought of this possibility...
Some stores sell large objects that are already boxed. A single item may ship in two or three separate boxes, so simply calculating the largest box that will hold all of the item, let alone all of an order that may contain more than one such item, won't work in those cases.
An example is a store I worked on last year which sells fountains. Each fountain may come with a base and maybe with a column, and possibly with a light, or a motor/pump, or both. And each of those partial items (some of which
can't be sold separately) may already be in its own shipping container. So a single item order can end up being sent in two, three or even four boxes.
Did I make your day?
Rob