Trackr for Craft CMS

Configuration

Everything lives at Settings → Plugins → Trackr. The settings screen is one page with sections; this is what each of them decides.

Order statuses

SettingWhat it does
Shipped order statusWhere an order goes once everything on it has shipped.
Partially shipped order statusWhere it sits while some of it is still to go. Pro.
Delivered order statusWhere it goes once every shipment is marked delivered. Pro.
Move the order when tracking is addedOff records tracking without touching the status.
Count units for partial shipmentsHolds an order at partially shipped until every shippable unit is covered. Pro.
Write a note on the order historyRecords the carrier and number even when the status does not move.

If you have not created those statuses, the settings screen offers to. Commerce order statuses are project config, so creating one needs allowAdminChanges to be on — which it will not be on production. Create them in your development environment and deploy the config.

Move the order when tracking is added is the switch to reach for if your order statuses are driven by something else entirely. Trackr will still record tracking, still write the history note, still show the widget — it just will not move the order.

Carriers

SettingWhat it does
Default carrierPre-selected on the order screen.
New shipments start asThe delivery status a new shipment gets.
Detect the carrier from the tracking numberUsed when a CSV row or an API call gives a number but no carrier. Pro.
Preferred countryTwo-letter code. Carriers from this country sort to the top of the picker.

Auto-detection only fires when exactly one carrier's pattern matches. Two matches means no guess — putting a customer on the wrong carrier's website is worse than plain text.

The carrier list itself is at Trackr → Carriers, not here. See Usage.

The widget

The widget's whole appearance is settings, with a live preview on the screen that updates as you type.

SettingDefault
HeadingTrack your order
LayoutCards, compact list, or a plain table
Accent / Text / Muted / Background / Border / Button textSix colours
Corner radius6px
Show delivery status, ship date, service, carrier logo, track buttonAll on
Button labelTrack shipment
Footer textEmpty

To replace the markup completely, point widgetTemplate at a site template. It gets the same variables the built-in one does — see Usage.

The tracking page

SettingDefault
Tracking page enabledOn
URItrack
TemplateTrackr's own
Require the email on the orderOn
Max attempts / window10 attempts per 600 seconds, per IP

Leave "require the email" on. An order number alone is guessable — they are sequential on most stores — and the email is the only thing standing between a stranger and someone else's shipping information. The setting exists for stores whose order numbers are already random and private, not as a convenience.

Failed lookups answer identically whatever went wrong. Telling somebody that an order number exists but the email is wrong tells them the order number exists.

Notifications (Pro)

SettingDefault
Email on shipmentOff
Email on deliveryOff
SubjectsYour order {orderNumber} has shipped / …has been delivered
TemplatesTrackr's own

These are Trackr's own emails, separate from Commerce's status emails. If you already have a Commerce email on your shipped status, you do not want these as well — pick one.

Import

SettingWhat it does
Order number sourceWhich order field a CSV's order number matches — auto, the reference, or the number.
Column aliasesExtra header names to recognise, on top of the built-in loose matching.
Watched folderDirectory trackr/import/watch reads. Pro.
Archive processed filesMoves files aside once read, so cron does not re-import them. Pro.

The watched folder accepts a Craft alias, so @storage/trackr-inbox works.

API (Pro)

SettingDefault
API enabledOff
TokenEmpty

With no token configured the endpoint rejects everything, enabled or not. Generate a long random token; it is compared with hash_equals, so length is the only defence that matters.

Logging (Pro)

SettingDefault
Logging enabledOn
Store payloadsOn
Retention30 days

Payloads are the raw CSV row or API body that produced a shipment, which is what you want when a fulfilment service swears it sent something. They are also personal data with a shipping address in them — set a retention window you can justify, and php craft trackr/log/prune on cron.

Permissions

  • View shipments — the index, the order panel, shipment detail
  • Add, edit and delete tracking — nested under it
  • Manage carriers
  • View the activity log (Pro)

A warehouse user typically wants view plus add/edit, and nothing else.

Config file

Everything above can be set in config/trackr.php, which overrides the CP and greys the fields out:

<?php

return [
    'shippedStatusHandle' => 'shipped',
    'trackingPageUri' => 'order-tracking',
    'apiEnabled' => true,
    'apiToken' => App::env('TRACKR_API_TOKEN'),
];

Put the API token in .env rather than in the file. It is a bearer token for an endpoint that writes to orders.