I received a few requests to improve package handling in eShop Shipping Extension and got down to it. Originally, the setup would allow only a single package size for the whole store. Not very handy, I know, so when the request came in, I decided to go all out on version 1.4.
People can now choose between 3 different Package settings:
- Global – the original setting, a single package size for the whole site;
- Per Product – each product gets assigned a package, regardless of its options;
- Per Product Option – assign packages for each product option.
The concept of Package classes was added – in the Admin panel, create the package information you will be using in your store. (Click on the images to see them larger.)
Once you have your package classes set up, you’ll be able to access them in the eShop Product Entry Box. The location of the fields depends on the option selected in the eSE Settings screen.
Using Per Product settings, the form is placed right under the “Stock Available” field. Note that the Product Class is mandatory in this mode, so if you go in to the product, you won’t be able to set “Stock Available” to true unless you set a Package Class. For products that already existed before setting up Package Classes, the system will fall back to “Global” (default) functionality.
In Per Product Option mode, the Package Class field gets moved into the Product Options table. Again, the Package Class is mandatory when an Option Name is set.
In both Product and Product Options modes, the product dimensions of the items in the cart are processed before calling the rates, as if they were actual boxes inside one big box.
Adding Advanced Packaging was a huge challenge. Not only for me, but for everyone that ever tried to systematically fit several packages into a box, optimizing space as much as possible. There is a lot of math and logic involved, and from all the research I did, I found out that there is no optimal solution. The best anyone can get is “good enough”. Therefore, please be advised that quotes rendered with this plugin may be slightly different from the actual price charged by the courier.
Check out Wikipedia for Knapsack Problem and the Bin Packing Problem if you’d like to know more. For the time being, my tests rendered correct values from the Courier companies, but there are bound to be cases where there will be a difference in quotes. Any such cases will be investigated and the code adjusted.
You can get your copy of eShop Shipping Extension
v1.4 v2.4* from WordPress.org.
* v1.4 has come and gone. All versions since 1.4 contain its changes.
For more information on eShop Shipping Extension and the couriers it supports, check out the product page.
For bug reports, please use the forum.