• Resolved sagejohn

    (@sagejohn)


    The thing I am trying to do is taking this order number NOR102392910 and setting it as the tracking number within the Advanced Shipment Tracking plugin.

    Is this possible?

    I tried the following snippet:

    /*
    * AST: get UPS Tracking number from order number
    *
    */
    add_action( ‘woocommerce_rest_insert_order_detail’, ‘action_woocommerce_rest_insert_order_detail’, 10, 3 );
    function action_woocommerce_rest_insert_order_note( $order, $request, $true ) {
    //check if AST is active
    if ( !function_exists( ‘ast_insert_tracking_number’ ) ) return;

    //check order number
    if( strpos( $order->order_number, ‘1Z’ ) !== false ){

    $order_id = $request[‘order_id’];
    $status_shipped = 1;
    $tracking_number = $order->order_number;
    $tracking_provider = ‘Dawnwing’;

    ast_insert_tracking_number($order_id, $tracking_number, $tracking_provider, ”, $status_shipped );
    }
    }

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Adding Tracking Details for Advanced Shipment Tracking Plugin From Order Number’ is closed to new replies.