Allow overriding order items before being packed

Created on 8 March 2017, about 8 years ago
Updated 7 February 2025, 2 months ago

Had a conversation with bojanz in Slack.

The crux of my issue is this paragraph:

The problem I have is that if I create a custom packer to do this [remove items from being packed], then no other packer can ever run on the site, because my packer would have to be the first one that runs. There doesn't seem to be any flexibility there. I'm working with another developer on commerce_fedex, with a custom packer there to handle things such as special packing for dry ice and hazmat shipments. That is a good use case for a custom packer it seems, but I would't be able to use it on my site because I want to remove quote items from being packed and that requires me to take over the entire packing process.

His idea for a potential solution to that:

I guess we could refactor $order->getItems() into a helper method on the DefaultPacker that runs an event afterwards

I just about have a patch ready for testing and further discussion on this issue, as well.

✨ Feature request
Status

Needs work

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States bmcclure West Virginia

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States dbroll

    I've adjusted the patch for 2.11 if anyone else needs it. For my use case I needed to remove RFQ items from the shipping quote calculations.

Production build 0.71.5 2024