webhat
9/20/2017 - 6:52 PM

For Shipment Tracking version 1.3.6 or below

For Shipment Tracking version 1.3.6 or below

<?php

$order_id = method_exists($order, 'get_id') ? $order->get_id() : $order->id;

//getting shipping details
$tracking_number = get_post_meta($order_id, '_tracking_number', TRUE);
if (isset($tracking_number) && !empty($tracking_number)) {
    $order_data['shipping_details'] = array(
        'tracking_provider' => get_post_meta($order_id, '_tracking_provider', TRUE),
        'tracking_number' => $tracking_number,
        'date_shipped' => get_post_meta($order_id, '_date_shipped', TRUE)
    );
}