It is possible to add the Track & Trace code to a customer email, so that they would get informed about their order and its shipment. Our plugin supports an easy to use option, without requiring coding skills and a more advance option for developers.
In this article we’re going to explain both options and how to use them. If you’re not a developer yourself, please stick to the first option.
Enable Track & Trace checkbox
From version 2.1.0 we have added a checkbox to the plugin settings, wether or not to add the Track & Trace code in the emails send to customers with regards to orders. In other words, the Track & Trace code will be added in all related default WooCommerce email templates.
Without having to code yourself, you can easily enable this option via WordPress dashboard > WooCommerce > Settings > vidaXL tab > Settings mini-tab.
As long as the below action hook will be present in the email templates, everything will work perfectly fine with this setting only.
Besides the checkbox for sending Track & Trace code in emails, we have also introduced using a shortcode to display the Track & Trace URL.
Example of the shortcode:
[vdl_track_and_trace label="Check Tracking: " order_id=500900]
Webshop owners who want to add the Track & Trace URL in WooCommerce customer emails, we recommend the following steps:
Navigate to WordPress dashboard > WooCommerce > Settings > Emails
Click Manage behind the order email you would like to add the Track & Trace to
If you don’t have a local copy of the email template click the button Copy file to theme
Click View template
Select the place of the template where you want to insert the Track & Trace code and add the following code to it:
echo do_shortcode('[vdl_track_and_trace order_id=' . $order->get_id() . ']');
Examples of using the code with additional text in the template:
echo "Track & Trace information: " . do_shortcode('[vdl_track_and_trace order_id=' . $order->get_id() . ']');
echo "Track & Trace information: " . do_shortcode('[vdl_track_and_trace label="Tracking: " order_id=' . $order->get_id() . ']');
The shortcode supports the following attributes:
the text printed in front of the tracking code URL
the order to be used to pull the tracking code from
In the code examples above, we have used the variable for vidaXL which is
vdl. However, if you are using the Van der Meer or BigBuy Dropshipping plugin, that variable will change. Below you will find the variable for each plugin.
Van der Meer