WooCommerce
WooCommerce copied to clipboard
Allow external code to provide shipment tracking data
Add filter mollie_shipment_tracking_data
to allow adding externally provided shipment tracking data before calling shipAll()
.
Fixes #425
Thanks for you contribution! This looks like an easy enough change. @asotela3911 what do you think?
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);