The packing method built in to Shipping Director is FirstFitSingleBox - Packing is based on "First Fit" using a Single Box Size. Products fit into first avail box that will take the volume and weight of products. If no existing box will fit the product, then a new box is started. It does check that the product will fit in the box's dimensions, but otherwise fit is based on volume of product vs. volume remaining in box, or weight of product vs weight remaining in the box. (If the product item's dimensions don't fit the box's dimensions, then a new box is created with the product's dimensions, and is considered "full" - no other items will go in that box.)
Here is a sample setup for Shipping Director to do packing.
Order | Type | Name | Expression | Rate Expression |
0 | Boolean | $Debug | true |
|
10 | Decimal | $PackageBoxMaxWeight | 20 |
|
20 | Decimal | $PackageBoxHeight | 15 |
|
30 | Decimal | $PackageBoxWidth | 15 |
|
40 | Decimal | $PackageBoxLength | 19 |
|
50 | Decimal | $PackageBoxWeight | 0.5 |
|
60 | Decimal | $PackageItemAddWeight | 0 |
|
70 | Decimal | $PackageItemAddDimension | 0 |
|
80 | Decimal | $PackageShrinkPercent | 0 |
|
90 | String | $ShippingRateRequest | "OneRequestPerSender" |
|
100 | Packing | FirstFitSingleBox | true | Packing.FirstFitSingleBox |
200 | OptionExit | FedEx | true | Shipping.Fedex |
All should be marked Active, and be sure to spell exactly as above including case, and quote or leading $ if any. The items with 0 in Expression can be left out if you like - their defaults are 0 anyway, but shown above so you know what all the special variable names (packing parameters) are. When adding the Packing-type record the Add Form will say "Packing Method" rather than Rate. (It always says Rate in the grid).
I think most special $ prefix variable names should be obvious, but here's a brief description of each:
Name | Expression |
$Debug | Turns on debugging. Debugging messages appears in the System Log. Because log messages are not HTML formatted, they can be hard to read in the browser. So, on a System Log record, click View to see the log detail page. Then, Right click the page and "View Source". Scroll down (a bit more than half way) until you see the plain text messages. |
$PackageBoxMaxWeight | Maximum Weight that the package will hold. If a product item does not fit in an existing box, then a new box is started. |
$PackageBoxHeight | Height dimension of the box. |
$PackageBoxWidth | Width dimension of the box. |
$PackageBoxLength | Length dimension of the box. |
$PackageBoxWeight | The weight of the box itself (empty). This is added to weight of contents for the total weight sent to FedEx. |
$PackageItemAddWeight | The weight of any packing material, per item. |
$PackageItemAddDimension | The dimension of packing material. This is added to each of the product item's dimension (H,W,L). |
$PackageShrinkPercent | After packing, "Shrinking" adjusts the dimensions of the package if the package is not at least n% full by volume. The cubed root of the used volume is used as the new dimensions (HxWxL). This allows for a "smaller" package when package is not full. $PackageShrinkPercent should be a number from 0 to 100 (it's a %). If 0 (not present), then no shrinking takes place. |
$ShippingRateRequest | This tells the Shipping Director how to call other shipping plugins when retrieving rate options: |
If box dimensions are not specified by above variables, then all items are packed in one box.
Update:
The $PackageBox variable is a shorthand for setting many package attributes in one line.
e.g. $PackageBox "MaxWeight:40,Height:15,Width:15,Length:15"
Here's how each shorthand attribute corresponds to the built in variable:
MaxWeight => $PackageBoxMaxWeight
Height => $PackageBoxHeight
Width => $PackageBoxWidth
Length => $PackageBoxLength
Weight => $PackageBoxWeight
AddWeight => $PackageItemAddWeight
AddDimension => $PackageItemAddDimension
ShrinkPercent=> $PackageShrinkPercent
The /APPENDPACKAGES Switch (Update 10/6/2018)
If a Packing rule is called multiple times, then each time it is called the set of packages are cleared and new packages are generated. To override that behavior and instead append addiitonal packages to the current set of packages, then use the /AppendPackages option following the packing method name:
Packing.FirstFitSingleBox /APPENDPACKAGES
Typically, you you append packages, you would also use the Packing method "Packing.ClearPackages" and/or use the Exclude Expression. Otherwise, you would double-pack the same items and that would increase the shipping rates that are caclulated by weight/dimensions. An example scenario for the AppendPackages would be to use a different $PackageBoxWeight for different types of items; be sure to use the Exclude Expression on each packing rule.