Adding Tracking Code to Custom Email template

nadeeem

New Member
Hello, I use alidropshp WOO version, I have the following 2 questions:


1. After tracking no. is available in aliexpress oder, I have to manually put the order id in my woocommerce order details page and then press "Get Tracking" to get the tracking number, Dont u think it wud be much better if it could fetch both the order id and/or tracking as per availability? Going to aliexpress account for the order ID is unncessary bcoz u already have integration with my aliexpress account thru chrome extension. If no tracking is available , it can fetch only the order id , otherwise Both order id and transaction no.

2. I found that after the tracking is fetched, it sends an order completion email with the tracking code attached, I think its the plugin which is attaching the tracking code. But I use (automate Woo)another plugin to send these email with woocoomerce email triggers, I customize the email template as per requirement. I just want to know how I can add that Tracking ID to my email template. Do u use any special custom Hook or can u suggest any short code or any snippet of code that I can use in my email template html editor so that I get the tracking code in my own email template.
 

Victoria Kudryashova

Administrator
Hello, I use alidropshp WOO version, I have the following 2 questions:


1. After tracking no. is available in aliexpress oder, I have to manually put the order id in my woocommerce order details page and then press "Get Tracking" to get the tracking number, Dont u think it wud be much better if it could fetch both the order id and/or tracking as per availability? Going to aliexpress account for the order ID is unncessary bcoz u already have integration with my aliexpress account thru chrome extension. If no tracking is available , it can fetch only the order id , otherwise Both order id and transaction no.

2. I found that after the tracking is fetched, it sends an order completion email with the tracking code attached, I think its the plugin which is attaching the tracking code. But I use (automate Woo)another plugin to send these email with woocoomerce email triggers, I customize the email template as per requirement. I just want to know how I can add that Tracking ID to my email template. Do u use any special custom Hook or can u suggest any short code or any snippet of code that I can use in my email template html editor so that I get the tracking code in my own email template.
1. You will not be able to collect Tracking IDs without AliExpress order number (which is attached during autofilling to the order).
2. function get_tracking($item_id, $order)

{ $ord = new \adsw\adsOrdersView( $item_id, $order->get_id() );

if( empty($ord->get_prop( 'adsw_tip' )) ) return null;
$tracking_link = get_option( 'adsw-tracking', '17track' );
return [
'order_number' => $ord->get_prop( 'adsw_order_number' ),
'url' => adsw_get_tracking_url( $tracking_link ) . $ord->get_prop(
'adsw_tip' ),
'id' => $ord->get_prop( 'adsw_tip' )
];
}

where $order - order object in WooCommerce
$item_id - position ID in order
 
Top