With the Shipment Tracking extension you can provide customers with an easy way to track their shipments.
Tracking info on the frontend
After adding details to an order, the tracking information will appear in emails, the order tracking page, and the order view page in their account section. For the best effect, add tracking info just before ‘completing’ an order.
Shipment Tracking
The Shipment Tracking extension provides customers with an easy way to track shipments by adding a link to emails and order pages.
Adds shipment tracking to emails sent to the customer (e.g., Completed Order email).
Installation
Ensure you have latest version of WooCommerce installed
Unzip and upload the plugin’s folder to your /wp-content/plugins/ directory
Activate the extension through the ‘Plugins’ menu in WordPress
Adding tracking information to orders
Please note: the shipment tracking details are added to the “completed order” email once the order status is marked as completed.
On the edit/view order screen, you will see a new write panel for shipment information:
Adding Order Shipment Tracking
To add shipment information for the customer to view:
Shipment Tracking Details
Choose a provider. This should be the shipping company you use. If your provider is not listed, choose the Custom Provider option.
Add the tracking number that the provider assigned. If you chose the custom option, you need to enter the full link to the company’s tracking page (if applicable).
Choose a shipping date (optional), which is when the package was shipped.
(optional) Test the preview link to see if it works as you expect.
Save the order. This is also a good time to change the order status to Complete. The customer will then receive an email with tracking code.
(optional) Add additional tracking numbers by selecting Add Tracking Number.
Custom Meta Reference
The Shipping Tracking plugin stores the tracking information in the order meta with the meta key _wc_shipment_tracking_items. It’s an array with the following structure:
tracking_provider — String of predefined provider
custom_tracking_provider — String of custom provider
custom_tracking_link — String of custom tracking URL
tracking_number — String of tracking number
date_shipped — Timestamp of shipment date
Developers can use the helper function wc_st_add_tracking_number to add tracking info to an order. In this helper function the field $custom_url is optional. Example usage:
if ( function_exists( 'wc_st_add_tracking_number' ) ) {
Note: This is a Developer level section. If you are unfamiliar with code and resolving potential conflicts, select a WooExpert or Developer for assistance. We are unable to provide support for customizations under our Support Policy.
The plugin provides a hook for changing the default provider from ‘custom’ called ‘woocommerce_shipment_tracking_default_provider’. This can be used by adding a custom function to your theme functions.php file and passing back the name of the provider, which should be the default:
The shipment tracking REST API allows you to create, view, and delete individual shipment tracking. The endpoint is /wp-json/wc/v1/orders/shipment-trackings.
Shipment Tracking Properties
ATTRIBUTE
TYPE
DESCRIPTION
tracking_id
string
Unique identifier for shipment tracking
read-only
tracking_number
string
Tracking number
required
tracking_provider
string
Tracking provider name
tracking_link
url
Tracking link
date_shipped
date
Date when package was shipped
Create a shipment tracking
POST /wp-json/wc/v1/orders/<order_id>/shipment-trackings
If predefined provider name is used, then no need to pass tracking_link.
0 Comments:
Post a Comment
Note: only a member of this blog may post a comment.
Subscribe to Post Comments [Atom]
<< Home