Ask HN: Automated shipping calculations for a shopping cart
2 comments
Direct link: http://www.doleaf.com - The actual site isn't really related to the problem, but come take a look anyway ;)
With shipping calculation there is usually two options you can use FedEx or UPS provided standard size boxes or you can use your own boxes. The latter option is what you are looking at for your problem. The bare minimum information you need about the shipping item is weight. FedEx and UPS both return your rates if you give their API the weight and addresses.
As for calculating the number boxes you will need to do that based on how your warehouse is gonna ship these products. This is the hardest part. Most people usually maintain the dimensions of the actual product. Based on this and how you plan to ship them you will need to figure the number of boxes. The shipping rates that you have negotiated with UPS/FedEx is usually a little lower than what the user will see, so this more often than not should cover your extra costs that you may incur.
Although calculating the number of boxes and their dimension is a little involved it gives you more accuracy. Which is better for you and your customer.
As for calculating the number boxes you will need to do that based on how your warehouse is gonna ship these products. This is the hardest part. Most people usually maintain the dimensions of the actual product. Based on this and how you plan to ship them you will need to figure the number of boxes. The shipping rates that you have negotiated with UPS/FedEx is usually a little lower than what the user will see, so this more often than not should cover your extra costs that you may incur.
Although calculating the number of boxes and their dimension is a little involved it gives you more accuracy. Which is better for you and your customer.
For the most part, our sellers will be shipping plants. Only so many will fit in a single box, and for many, like trees, it's pretty much 1-1. So, if a buyer can order any number of plants in any combination, how do we calculate the correct number of boxes, the weight of each one, and so forth? There might be a way to do it, given a lot of info up front, but we're also trying to minimize the amount of work for sellers when they're adding a new item. Shipping weight might be reasonable to ask, but complicated dimensions and questions like "How big is the box you use to ship?" are probably asking for too much.
Am I making this a much harder problem than it actually is? I looked over the Fedex API docs and was instantly confused by the 1000s of different options and parameters. So, I'm coming here in the hopes that a fellow HN'er has dealt with this before. If there are any resources or howtos that you know of, please send them my way.