You can easily add a shipment tracking number to your message template by following the straightforward method outlined in the linked post below. Additionally, we’ll guide you through creating a shipment tracking number placeholder for major WooCommerce shipping tracking plugins. With this approach, you can generate your own placeholder for any plugin, in particular with WooCommerce Email Template Customizer plugin by VillaTheme without requiring any developer expertise or coding skills.
WooCommerce Shipment Tracking plugin and Advanced Shipment Tracking for WooCommerce
With WooCommerce Shipment Tracking and Advanced Shipment Tracking, the shipment tracking number for your order is stored in the order meta (postmeta table) with the key _wc_shipment_tracking_items
. However, as the tracking number is saved as an array, you’ll need to specify the array key in the placeholder to ensure it functions correctly.
For order data, the placeholder format begins with {{order-}
. Following this, you need to specify your meta key, which for Shipment Tracking by WooCommerce and Advanced Shipment Tracking is _wc_shipment_tracking_items
. Since the details are stored in an array and the array key for the tracking number, as per their documentation, istracking_number
, you’ll need to include this in the placeholder with a colon separator (:
), like :tracking_number
. Therefore, the final placeholder will appear as follows:
{{order-_wc_shipment_tracking_items:tracking_number}}
By employing this approach, you can generate placeholders for any value associated with the plugin or any other plugin that stores data in the database using an array. If you’re uncertain about your meta key and array, you can reach out to the developer of the respective plugin for clarification. Alternatively, you can explore your database independently to gather this information.
Below are placeholders that can be used for these 2 tracking plugins:
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}}
Note: Please note that the provided shortcodes are specifically designed for use with the WooCommerce Shipment Tracking Plugin and Advanced Shipment Tracking. However, you can apply the same method to create placeholders for any plugin that stores data in an array format.
The shortcode of WooCommerce Shipment Tracking and Advanced Shipment Tracking for WooCommerce will be written in WooCommerce Email Template Customizer like these:
Tracking Number: [wec_order_meta key="_wc_shipment_tracking_items" array_key="tracking_number"]
Tracking Provider: [wec_order_meta key="_wc_shipment_tracking_items" array_key="tracking_provider"]
Date Shipped: [wec_order_meta key="_wc_shipment_tracking_items" array_key="date_shipped"]
Custom Tracking Provider: [wec_order_meta key="_wc_shipment_tracking_items" array_key="custom_tracking_provider"]
Custom Tracking Link:[wec_order_meta key="_wc_shipment_tracking_items" array_key="custom_tracking_link"]
WooCommerce Shipping Tracking
WooCommerce Shipping Tracking stores data not only in a single meta key but also utilize an array format for additional tracking numbers. As the data resides in the postmeta table, the tracking placeholders will begin 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}}
Note: The shortcodes are specifically designed for use with the WooCommerce Shipping Tracking plugin. However, you can apply the same method to create placeholders for any plugin that stores data in an array format.
The shortcode of WooCommerce Shipping Tracking will be written in WooCommerce Email Template Customizer like these:
Primary Tracking Number: [wec_order_meta key="_wcst_order_trackno"]
Primary Courier Name: [wec_order_meta key="_wcst_order_trackname"]
Primary Dispatch Date: [wec_order_meta key="_wcst_order_dispatch_date"]
Primary Custom Text: [wec_order_meta key="_wcst_custom_text"]
Primary Tracking URL:[wec_order_meta key="_wcst_order_track_http_url"]
Additional Tracking Number: [wec_order_meta key="_wcst_additional_companies" array_key="_wcst_order_trackno"]
Additional Courier Name: [wec_order_meta key="_wcst_additional_companies" array_key="_wcst_order_trackname"]
Additional Dispatch Date: [wec_order_meta key="_wcst_additional_companies" array_key="_wcst_order_dispatch_date"]
Additional Custom Text: [wec_order_meta key="_wcst_additional_companies" array_key="_wcst_custom_text"]
Additional Tracking URL: [wec_order_meta key="_wcst_additional_companies" array_key="_wcst_order_track_http_url"]
Yith WooCommerce Order Tracking
As Yith doesn’t store its tracking data in an array format like the previous plugin, creating and understanding the placeholder is much simpler. Additionally, most plugins don’t store their data in an array, so this process will be the same for many plugins.
The data from Yith is stored in the postmeta table of WordPress, so the placeholder will start with {{post-
as a prefix. Their tracking data is stored with the metaywot_tracking_code
, so the tracking code for this plugin will be represented as follows: {{post-ywot_tracking_code}}
.
Since no array is used in this data, we will not use an array identifier for this placeholder. This method allows you to create a placeholder for any plugin or tracking plugin that does not store its data in an array. If an array is used, then the ‘Shipment Tracking by WooCommerce’ method should be applied.
If you are uncertain about your meta key, you can contact the developer of the respective plugin or inspect your database to find it.
Below are placeholders that can be used 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}}
Note: Please note that the provided shortcodes are specifically designed for use with the Yith WooCommerce Order Tracking. However, you can apply the same method to create placeholders for any plugin that stores data in an array format.
The shortcode of Yith WooCommerce Order Tracking will be written in WooCommerce Email Template Customizer like these:
Tracking Code: [wec_order_meta key="ywot_tracking_code"]
Carrier Name: [wec_order_meta key="ywot_carrier_name"]
Pickup Date: [wec_order_meta key="ywot_pick_up_date"]
Premium Version
Carrier Name: [wec_order_meta key="ywot_carrier_id"]