A WooCommerce plugin that stops the store offering a carrier the order will not fit.
Role
Sole engineer: plugin, rules engine, and test harness
Stack
PHPWordPressWooCommerceJavaScriptShipStation
Trigger: 01Cart pricedShipping rates requested
Process: 02Capacity scoredPer-product limits become one figure
Process: 03Rules matchedCarriers that cannot take it drop out
Output: 04Checkout narrowedCustomer sees only what works
Output: 05Order flaggedPacker reads the reason on the slip
Checkout settles the packing problem, so the bench never has to.
The problem
Most orders fit an envelope service, and some never will. Nothing stopped a customer picking the cheap carrier for an order that would not fit it, so the mistake surfaced at the packing bench: photograph the slip, send it to another office, wait ten to fifteen minutes for the label to be re-cut.
What I built
Each product carries one number: how many of it fit in one envelope. That is the only figure anyone types.
Underneath, I score the cart against a shared capacity, because a per-product limit alone cannot judge a mixed cart. Twenty-fit is five points, two-fit is fifty, and anything over a hundred upgrades. Change the capacity later and every product rescales instead of going stale.
Values resolve variation, then product, then shipping-class default, then nothing set. The admin screen shows which figure won and where it came from, so a surprising result is one you can explain.
I build the rules from the store's real shipping zones and from rates seen on live carts. There is no carrier name to type from memory, and no rule that matches nothing without saying so.
It installs switched off and in simulate mode. Nothing gets hidden and no customer sees anything, but orders are still flagged and every decision logged. Run it a week, compare the flagged orders against the ones your packers had to redo, then let it touch a checkout.
A flagged order carries its reason onto the packing slip, so the person at the bench reads the decision instead of rediscovering it.
A test suite that runs against WordPress stubs, which lets me exercise the rules without a WordPress install.