Skip to content

Allow external code to provide shipment tracking data#863

Open
Kimmax wants to merge 2 commits intomollie:developfrom
Kimmax:kimmax-mollie_shipment_tracking_data
Open

Allow external code to provide shipment tracking data#863
Kimmax wants to merge 2 commits intomollie:developfrom
Kimmax:kimmax-mollie_shipment_tracking_data

Conversation

@Kimmax
Copy link
Copy Markdown

@Kimmax Kimmax commented Nov 21, 2023

Add filter mollie_shipment_tracking_data to allow adding externally provided shipment tracking data before calling shipAll().
Fixes #425

Allow external code to provide shipment tracking data before calling `shipAll()` on mollie order
@fjbender
Copy link
Copy Markdown

Thanks for you contribution! This looks like an easy enough change. @asotela3911 what do you think?

@Kimmax
Copy link
Copy Markdown
Author

Kimmax commented Nov 22, 2023

Maybe should add some kind of verification / documentation / make sure the returned data is in the correct format:

add_filter('mollie_shipment_tracking_data', function ($input, $order) {
    return [
        'tracking' => [
            'carrier' => '...',
            'code' => '...',
            'url' => '...',
        ];
    ];
}, 10, 2);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Submitting a valid tracking instead of a plain shipAll()

2 participants