I'd be interested to know how people have implemented shipping calculations on their sites.

Our site sells a variety of items weighing from 1g to several Kg and a variety of sizes from things that fit into an envelope to things that are over a metre long. This means that a large number of shipping rates could apply and calculating the best one is non-trivial as the choice of packaging can affect the rate.

I've written some code which seems to be fairly accurate at predicting the correct postage under most circumstances; but even I stopped short of implementing a packing algorithm which could predict how much of an order can fit into a Jiffy bag! I take into account the maximum volume of envelopes and boxes, their weight, individual item weights and volumes etc. I also take into account the maximum weights and dimensions allowed for each postage rate.

How do most people cope with this situation?

Regards,
David Legg

Reply via email to