Getting Started
Features
Querying Elements
Developers
Tracking Carrier
A tracking carrier stores tracking information and has helper methods to return tracking URLs.
Attributes
Description | |
---|---|
|
The shipment tracking number. |
|
Override the default order by specifying an integer. |
Methods
Description | |
---|---|
|
Returns the display name of the carrier. |
|
Returns the tracking URL for the carrier formatted with the tracking number. |
Register Custom Carrier
If your carrier is not available in the default list, you can register your own.
use craft\events\RegisterComponentTypesEvent;
use tasdev\orderfulfillments\services\Carriers;
use yii\base\Event;
Event::on(Carriers::class, Carriers::EVENT_REGISTER_CARRIERS, function(RegisterComponentTypesEvent $e) {
$e->types[] = MyCarrier::class;
});
To see what your MyCarrier
class might look like, take a look at the default classes.