1. Home
  2. Docs
  3. Shipment Tracker for Wooc...
  4. Developers
  5. Public Functions

Public Functions

1. bt_get_shipping_tracking($order_id);
Returns associative array containing shipment tracking data of a specific order.
Parameters:
  • $order_id
    (number) The ID of the order whose shipment tracking details have been updated.
Returns:
  • Array
    (Array) Associative array containing shipment tracking data.
Example:
  1. <?php
  2.         if(function_exists(‘bt_get_shipping_tracking’))
  3.         {
  4.               $shipment_obj = bt_get_shipping_tracking($order_id);
  5.               if($shipment_obj != null)
  6.               {
  7.                     $courier_name = $shipment_obj[“courier_name”];
  8.                     $current_status = $shipment_obj[“current_status”];
  9.                     $awb = $shipment_obj[“awb”];
  10.                     $tracking_url = $shipment_obj[“tracking_url”];
  11.               }            
  12.         }

 

2. bt_force_sync_order_tracking($order_id);
Fetches shipment tracking information from the respective shipment provider that is associated with the specific order.

Parameters:

  • $order_id
    (number) The ID of the order whose shipment tracking details have been updated.
Returns:
  • Array
    (Array) Associative array containing shipment tracking data.
Example:
  1. <?php
  2.         if(function_exists(‘bt_force_sync_order_tracking’))
  3.         {
  4.               $shipment_obj = bt_force_sync_order_tracking($order_id);
  5.               if($shipment_obj != null)
  6.               {
  7.                     $courier_name = $shipment_obj[“courier_name”];
  8.                    $current_status = $shipment_obj[“current_status”];
  9.                    $awb = $shipment_obj[“awb”];
  10.                    $tracking_url = $shipment_obj[“tracking_url”];
  11.              }
  12.        }

 

3. bt_update_shipment_tracking($order_id,$courier_name,$awb_number,$shipping_status,$edd,$tracking_link);
Saves shipment tracking data of an order.
Parameters:
  • $order_id
    (number) The Order ID.
  • $courier_name
    (string) Courier Name.
  • $awb_number
    (string) AWB Number.
  • $shipping_status
    (string) Shipping Status.

Possible Values: pending-pickup, out-for-pickup, in-transit, out-for-delivery, delivered, canceled, rto-in-transit, rto-delivered

Note: Assigning a value other than above will also work.

  • $edd
    (string) Estimated Delivery Date (eg. 2022-03-15).
  • $tracking_link
    (string) The Tracking url. Set to empty string to use global tracking url defined in plugin settings.
Returns:
Array
(Array) Associative array containing shipment tracking data.
Example:
  1. <?php
  2.        if(function_exists(‘bt_update_shipment_tracking’))
  3.        {
  4.              $shipment_obj = bt_update_shipment_tracking ($order_id,$courier_name, $awb_number, $shipping_status, $edd,                           $tracking_link);
  5.        }

How can we help?