WooCommerce icon indicating copy to clipboard operation
WooCommerce copied to clipboard

Allow external code to provide shipment tracking data

Open Kimmax opened this issue 9 months ago • 2 comments

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

Kimmax avatar Nov 21 '23 13:11 Kimmax

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

fjbender avatar Nov 21 '23 13:11 fjbender

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);

Kimmax avatar Nov 22 '23 17:11 Kimmax