Last active
November 19, 2017 14:35
-
-
Save web-hat/7346762f3edb39d194c904685406e1d8 to your computer and use it in GitHub Desktop.
For Shipment Tracking version 1.4.0 or above
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$order_id = method_exists($order, 'get_id') ? $order->get_id() : $order->id; | |
//getting shipping details | |
$objWC_Shipment = WC_Shipment_Tracking_Actions::get_instance(); | |
$shipping_details = $objWC_Shipment->get_tracking_items($order_id); | |
if (!empty($shipping_details)) { | |
foreach ($shipping_details as $shipping_detail) { | |
$order_data['shipping_details'][] = array( | |
'tracking_provider' => $shipping_detail['tracking_provider'], | |
'tracking_number' => $shipping_detail['tracking_number'], | |
'date_shipped' => $shipping_detail['date_shipped'] | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment