Using tracking and parcel point hooks (Boxtal connect WooCommerce)
The module offers hooks related to shipment tracking and choices of parcel points that you can use to personalize your Wordpress site and emails.
Display the parcel point chosen for an order
For example, you can add the parcel point chosen for an order in the order confirmation email by adding in the email template:
/*
* @hooked Api_Action::print_order_parcelpoint() Prints parcel point details
*/
do_action( 'boxtal_connect_print_parcelpoint', $order);
To modify the template of an email directly from your interface, go to WooCommerce > Settings > Emails and select the email you want to modify (for example the email of Processing order) .
Click Copy file to theme (if you've not already done so previously) to edit the file in your theme (so WooCommerce updates don't overwrite your changes). WooCommerce tells you where to find the file to edit.
You can modify the file directly, or in the interface by finding the file in Appearance > Theme file editor.
WooCommerce allows you to test email sending via WooCommerce > Email Test to see the result using an order placed on Boxtal.
Show order tracking link
You can also add an order's tracking link this way:
/*
* @hooked Api_Action::print_tracking_number() Prints shipping number
*/
do_action( 'boxtal_connect_print_tracking_number', $order);
Add an action to a tracking event
When the order is shipped
function my_order_shipped_function($order_id) {
/* your code here */
}
add_action( 'boxtal_connect_order_shipped', 'my_order_shipped_function' );
When the order is delivered
function my_order_delivered_function($order_id) {
/* your code here */
}
add_action( 'boxtal_connect_order_delivered', 'my_order_delivered_function' );