mollie / WooCommerce

Official Mollie extension for WooCommerce
https://wordpress.org/plugins/mollie-payments-for-woocommerce/
Other
130 stars 52 forks source link

Allow external code to provide shipment tracking data #863

Open Kimmax opened 9 months ago

Kimmax commented 9 months ago

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

fjbender commented 9 months ago

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

Kimmax commented 9 months ago

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