What are you trying to do?
Hi there! Thanks for making Postie awesome.
We've got a client who sells super small, lightweight products. It's not unheard of for an order to contain quantities of 50,000 - 100,000 (usually just a handful of line items, but each having really high quantities)
We've found that when line item quantities get large, the box packing algorithm ends up timing out.
They don't use dimensions for their products (just weight), so the box packing seems a little fruitless in this case.
Are there any hooks we could use to bypass the default box packing & instead provide our own box packing logic (in most cases, this would just be a single box with the total weight of the products).
What's your proposed solution?
I could see it being useful to have some hooks or config options for customizing how items are added to the box packer.
- For each line item, modify how it's added to the packer
- In our use case, we'd probably merge together items that are super small, or have no dimensions.
- Or... it might also be useful to modify and merge together items right before calling $packer->pack()
- Although... it doesn't seem like the Packer class exposes its items.
- Provide a way to inject a custom packer class - right around here
It's a bit yucky opening up these internal features, but we've got a very unique Craft Commerce client (with 662,650 products & counting).
Feels like perhaps the cleanest path would be to let folks override the InfalliblePacker class with their own version of the Packer class. I'd love to hear your thoughts on these solutions.
I'm more than happy to make a PR for this if you feel it's worth pursuing.
Additional context
No response
What are you trying to do?
Hi there! Thanks for making Postie awesome.
We've got a client who sells super small, lightweight products. It's not unheard of for an order to contain quantities of 50,000 - 100,000 (usually just a handful of line items, but each having really high quantities)
We've found that when line item quantities get large, the box packing algorithm ends up timing out.
They don't use dimensions for their products (just weight), so the box packing seems a little fruitless in this case.
Are there any hooks we could use to bypass the default box packing & instead provide our own box packing logic (in most cases, this would just be a single box with the total weight of the products).
What's your proposed solution?
I could see it being useful to have some hooks or config options for customizing how items are added to the box packer.
It's a bit yucky opening up these internal features, but we've got a very unique Craft Commerce client (with 662,650 products & counting).
Feels like perhaps the cleanest path would be to let folks override the
InfalliblePackerclass with their own version of thePackerclass. I'd love to hear your thoughts on these solutions.I'm more than happy to make a PR for this if you feel it's worth pursuing.
Additional context
No response