A shipment tracking number can be added to your message template by a simple method described in the post linked below. We’ll even show how to create shipment tracking number placeholder for two major WooCommerce plugins out there, Shipment Tracking by WooCommerce and Yith WooCommerce Order Tracking, so by using this method you can create your own placeholder for any plugin out there without any developer knowledge or coding.
We even recommend reading the below-linked article or at least having a glimpse of it before proceeding with one, so we can have a better understanding of what we are doing.
Shipment Tracking by WooCommerce
As per the document by WooCommerce https://docs.woocommerce.com/document/shipment-tracking/ the shipment tracking number of your order is saved under order meta (postmeta table) with the key _wc_shipment_tracking_items, but since they are saving the tracking number as an array you’ll also need to mention their array key in our placeholder to make it work properly.
So for order data, the format for placeholder starts with {{order- after this, you have to mention your meta key, which in Shipment Tracking by WooCommerce‘s case is _wc_shipment_tracking_items and since they are saving the details in an array and array key for shipping number as per their document is tracking_number so we’ll need to add this into the placeholder with colon separator (:) like :tracking_number. So the final placeholder will look like the below.
{{order-_wc_shipment_tracking_items:tracking_number}}
And using this method you can create placeholder for any of their value or any other plugin which uses an array to store data in the database. If you are not sure what your meta key and array are then you can contact the developer of that respective plugin to know about that, or you can also try to look into your database yourself and find about it.
You can also use the below placeholders which will work for this plugin
Tracking Number: {{order-_wc_shipment_tracking_items:tracking_number}}
Tracking Provider: {{order-_wc_shipment_tracking_items:tracking_provider}}
Date Shipped: {{order-_wc_shipment_tracking_items:date_shipped}}
Custom Tracking Provider: {{order-_wc_shipment_tracking_items:custom_tracking_provider}}
Custom Tracking Link: {{order-_wc_shipment_tracking_items:custom_tracking_link}}
We have also created integration with Shipment Tracking plugin so you can even render tracking links for this
Tracking Link: {{wc-tracking-link}}
Please note that the above-provided shortcodes will only work for Shipment Tracking Plugin by WooCommerce. But you can create placeholders for any plugin which stores data in an array format using the same method.
Advanced Shipment Tracking for WooCommerce
The data of Advanced Shipment Tracking for WooCommerce is stored in postmeta table of WordPress so the placeholder will start with {{post- as a prefix and their tracking data are stored in an array.
Tracking Number: {{post-_wc_shipment_tracking_items:tracking_number}}
Tracking Provider: {{post-_wc_shipment_tracking_items:tracking_provider}}
Date Shipped: {{post-_wc_shipment_tracking_items:date_shipped}}
Custom Tracking Provider: {{post-_wc_shipment_tracking_items:custom_tracking_provider}}
Custom Tracking Link: {{post-_wc_shipment_tracking_items:custom_tracking_link}}
We have also created integration with Shipment Tracking plugin so you can even render tracking links for this
Tracking Link: {{wc-tracking-link}}
Please note that the above-provided shortcodes will only work for Advanced Shipment Tracking for WooCommerce by Zorem. But you can create placeholders for any plugin which stores data in an array format using the same method.
AfterShip – WooCommerce Tracking
The data of AfterShip – WooCommerce Tracking is stored in postmeta table of WordPress so the placeholder will start with {{post- as a prefix and their tracking data is stored in meta key.
Tracking Number: {{post-_aftership_tracking_number}}
Carrier Name: {{post-_aftership_tracking_provider_name}}
Shipment Date: {{post-_aftership_tracking_shipdate}}
Tracking Postal: {{post-_aftership_tracking_postal}}
Destination Country: {{post-_aftership_tracking_destination_country}}
Please note that the above-provided shortcodes will only work for AfterShip – WooCommerce Tracking. But you can create placeholders for any plugin which stores data in meta key format using the same method.
Yith WooCommerce Order Tracking
Since yith doesn’t save their tracking data in array format like the above plugin, so it’s way easier to create and understand the placeholder and most plugins out there don’t save their data in an array so this process will be same for most of the plugins.
The data of Yith is stored in postmeta table of WordPress so the placeholder will start with {{post- as a prefix and their tracking data is stored with meta ywot_tracking_code so the tracking code for this plugin will be
{{post-ywot_tracking_code}}
Since there is no array being used in this data so we will not use array identifier in this placeholder.
Using this method you can create placeholder for any plugin or tracking plugin out there if they don’t store their data in an array, if an array is used then use the Shipment Tracking by WooCommerce method. If you are not sure what your meta key is then you can contact the developer of that respective plugin to know about that, or you can also try to look into your database yourself and find about it.
You can also use the below placeholders which will work for this plugin
Tracking Code: {{post-ywot_tracking_code}}
Carrier Name: {{post-ywot_carrier_name}}
Pickup Date: {{post-ywot_pick_up_date}}
Premium Version
Carrier Name: {{post-ywot_carrier_id}}
Please note that the above-provided shortcodes will only work for Yith WooCommerce Order Tracking. But you can create placeholders for any plugin using the same method.
WooCommerce Shipping Tracking
These guys are creative, they not only save data in single meta key but for additional tracking numbers they use array format. Since the data is stored in postmeta table so the tracking placeholders will start with {{post-
Primary Tracking Number: {{post-_wcst_order_trackno}}
Primary Courier Name: {{post-_wcst_order_trackname}}
Primary Dispatch Date: {{post-_wcst_order_dispatch_date}}
Primary Custom Text: {{post-_wcst_custom_text}}
Primary Tracking URL: {{post-_wcst_order_track_http_url}}
Additional Tracking Number: {{post-_wcst_additional_companies:_wcst_order_trackno}}
Additional Courier Name: {{post-_wcst_additional_companies:_wcst_order_trackname}}
Additional Dispatch Date: {{post-_wcst_additional_companies:_wcst_order_dispatch_date}}
Additional Custom Text: {{post-_wcst_additional_companies:_wcst_custom_text}}
Additional Tracking URL: {{post-_wcst_additional_companies:_wcst_order_track_http_url}}
Please note that the above-provided shortcodes will only work for WooCommerce Shipping Tracking. But you can create placeholders for any plugin using the same method.
Claudio Sanches – Correios for WooCommerce
Correios shipment tracking plugin saves the tracking number data as an array as they support multiple tracking numbers for the same order.
Tracking Number: {{order-_correios_tracking_code}}
Please note that the above-provided shortcodes will only work for Claudio Sanches – Correios for WooCommerce. But you can create placeholders for any plugin using the same method.
DHL for WooCommerce
The data of Advanced Shipment Tracking for WooCommerce is stored in postmeta table of WordPress so the placeholder will start with {{post- as a prefix and their tracking data are stored in an array.
Tracking Number: {{order-_wc_shipment_tracking_items:tracking_number}}
Tracking Provider: {{order-_wc_shipment_tracking_items:tracking_provider}}
Date Shipped: {{order-_wc_shipment_tracking_items:date_shipped}}
Custom Tracking Provider: {{order-_wc_shipment_tracking_items:custom_tracking_provider}}
Custom Tracking Link: {{order-_wc_shipment_tracking_items:custom_tracking_link}}
Please note that the above-provided shortcodes will only work for DHL for WooCommerce. But you can create placeholders for any plugin which stores data in an array format using the same method.