Record Consignment Numbers and Tracking URL
Overview
The consignment numbers allows integrators to add tracking URLs from supported carriers.
Configuration
Tracking URLs can be managed in Shipping > Tracking URLs.
Tracking URLs are composed of following details:
Property | Details | |
---|---|---|
Name | The unique name for the tracking URL/carrier | |
Pattern | The consignment/tracking id pattern. This is used for mapping the consignment number to a tracking url. This field requires a regex pattern. There should be one pattern per line (for multiple patterns) Sample:
| |
URL | The tracking url for the carrier website. This field requires [TRACKING_ID] token, which is replaced by the consignment number. |
Integration
Adding Consignment Numbers
- In the admin, go to Transactions > Commerce and select an order.
- Enter a Shipping Consignment ID. When navigating away from the text field, the page will calculate and auto-select the carrier which matches the ID pattern
- Optionally, you manually change the auto-selected carrier by selecting the correct carrier from the dropdown.
- Click update to save the changes.
Frontend Integration
The tracking URLs are auto generated using order's selected carrier and consignment ID value. This value is exposed in following areas in the frontend:
- Order shipped templates via campaign module. Can be accessed via $order_tracking_url variable.
- Trackorders via getTrackingUrl() method in the order object.