verbb / postie

A Craft Commerce shipping calculator plugin.
Other
12 stars 18 forks source link

[FR] Box Packing Management for standard box sizes #32

Closed dwhoban closed 3 years ago

dwhoban commented 4 years ago

Description

When a Craft site has bulky goods, Price Calculations tend to fail as items are stacked on top of each other. This leads to a null result on larger orders.

My solution is to allow customers to set default box sizes for their orders and have Postie "fill" those boxes to generate pricing.

I came across an example packing algorithm which does something similar ( I know... I know...).

Stories

MVP

When I am configuring Postie I want to be able to define a standard packing box size so that I can have postage calculated based on the size of the box and the weight of the contained items. (should this include weight?)

When a customer has an order that fills the box size available a new box should be created and postage calculated on both boxes.

MVP++++

(I am not sure if these are even possible but I can see the use case)

When I am configuring Postie for a provider I want to be able to define a standard packing box size so that I can have postage calculated based on the size of the box and the weight of the contained items.

When I am configuring Postie for a provider I want to be able to define multiple packing box sizes so that I can have postage calculated based on the size of the box and the weight of the contained items.

When I am configuring a standard box size, Postie should check against the provider API that the package size is able to be priced and return an error if not.

When a customer has an order that fills the smallest box size available, postie should recalculate on the next size up, until the largest box is filled. Once the largest box is filled the process repeats.

engram-design commented 4 years ago

This is certainly still on my radar. I plan to have a table where you can add your own boxes in the control panel for each provider. Potentially for each shipping method (but we'll see).

Having these as a table will allow you to order them arbitrarily. Typically, this will be from smallest to largest, so Postie will try and fit in the smallest, then keep going. But there are situations where this might not be desirable, so a custom order will be possible.

From this user-provided information, we can then use a box-packing algorithm to find the best box for the customers items. The trick here will be saving this chosen box somewhere meaningful, ideally on the order. You'll probably need to hook up a custom field to store this on the order.

dwhoban commented 4 years ago

Thanks @engram-design,

The custom field is how ShipStation Connect handles it. You add a matrix field and map the field names.

For what I need I would be happy with a single box across all providers, but your idea sounds awesome.

engram-design commented 3 years ago

Added in 2.4.0