# Minimum dimensions of shipping box: Identify smallest possible dimensions of a box used for shipping

 All requests > Minimum dimensions of shipping box > Request new recommendation > Featured requests > No recommendations

## Minimum dimensions of shipping box #minimum box size

by Paul Birkhead - 6 years ago (2016-04-14)

### Identify smallest possible dimensions of a box used for shipping

 +2 eCommerce shopping carts contain items that are being purchased. These items have weights and dimensions. Parcel shipping charges are often determined by the dimensions of the box used to ship the purchased products. The smaller the box, the less the charges. I would like to be able to feed the dimensions of each item in the cart to a PHP class, and have returned to me the length, width and height of the smallest box I could use to ship the order. The dimensions input should allow for fractional values. For example, 6.25 inches.
• 1 Clarification request
• 1. by Mohammad Keramatifar - 6 years ago (2016-05-18)

you mean that: 1- we have a data table or any other collection contains all packages dimensions> 2- and we have a product dimensions data table too? 3- now we need a class that suggest which product in which package?

• 2. by Paul Birkhead - 5 years ago (2016-05-19) in reply to comment 1 by Mohammad Keramatifar

Not quite. You do not have a data table containing package dimensions. You do have a collection of product dimensions which are those of the products that are in the shopping cart. All of the products will ship in one box. What would the dimensions of the box be if it is the smallest possible box that can be used to ship the product? If the products were pliable it would be a simple function of calculating the cubic volume and determining the dimensions of the cube. But products typically aren't pliable, so the dimensions of the box must large enough to accommodate the "real" (non-pliable) product dimensions.

## Bin packing: Implementation of one dimensional bin packing

 +1 by Manuel Lemos - 6 years ago (2016-04-15) CommentThere is this class that solves that problem but just for one dimension. For items with three dimensions I guess you need to adapt this solution considering that you can arrange the items in different ways. It is not a trivial problem but you may want to ask the author it ins support forum if he can help solving the problem for 3 dimensions. There is also this class that can solve the problem but assuming all items have the same sizes and you are fitting in containers of standard sizes. Maybe you can adapt this solution for your case if your items all have the same sizes.
For more information send a message to `info at phpclasses dot org`.