How Gatemi Shipment Tracking Works

A shipment is three facts — a tracking number, a carrier and an optional date — stored on the order. The plugin shows them wherever WooCommerce shows the order to its customer. Three rules govern how.

The flow, step by step

  1. You enter a number in the Shipment tracking box on the order (or, full edition, import it).
  2. The number is cleaned — spaces removed — and the date is kept only if it is a real YYYY-MM-DD date. The shipment is written onto the order in the meta key _gmst_shipments and the order is saved.
  3. Full edition: if this is the order's first shipment and Move the order on to another status is on, the order moves to the status you chose.
  4. From now on, every time WooCommerce shows that order to the customer, the tracking section is added.

Every carrier is a name and a link template with {tracking} where the number belongs. The order box, the customer's section and the settings screen all read the same list.

To build a link the plugin URL-encodes the number and puts it in place of {tracking}. It never just appends the number to the end of an address, so a number with unusual characters cannot break the link or change where it goes. A carrier with no link (Other) shows the number as plain text instead of a link that leads nowhere. Links open in a new tab.

Full edition: your own carriers join the list, and a carrier link must be an http or https address — a javascript: template is refused when it is saved.

Rule 2 — shipments belong to the order

Shipments live on the order itself, read and written through the order's own meta API, so the classic order store and HPOS work the same way. "Has this order shipped?" is answered by whether it has a shipment, not by a second flag that could disagree.

The free edition works with the first shipment on the order. If the full edition stored more than one, the free edition shows and edits the first and keeps the rest untouched. Clearing the number in the free edition removes only that first shipment.

Rule 3 — importing twice changes nothing (full edition)

Adding a number an order already carries updates that shipment rather than adding a second copy. Re-running yesterday's import — which people do whenever they are unsure the first run worked — adds nothing, and a second run can still correct a carrier or a date. Every line that is skipped is reported with its line number, never dropped in silence.

Where tracking appears

Place Free edition Full edition
My Account → order, below the order details Always When On My Account and the thank-you page is on
The thank-you (order-received) page Always Same switch
Every customer email about the order Always When In their order emails is on
Admin emails Never Never
[gatemi_tracking order="123"] — Wherever you place it

Emails are reached through WooCommerce's woocommerce_email_order_details hook, which every customer email fires. A status email added later — by WooCommerce or another plugin — gets tracking with nothing to set up. An HTML email gets the section with inline styles so it reads well in mail clients; a plain-text email gets plain text rather than markup that would arrive as angle brackets — the heading on its own line, then each shipment with its tracking address written out in full.

Admin emails are left alone because the shop already sees the order screen. An order with no shipment shows nothing at all — no empty "Track your shipment" heading on every unshipped order.

Worked example. An order ships in two parcels. In the full edition you add 1Z999AA10123456784 (UPS) and, a day later, JD014600003828 (DHL Express). The customer's section lists both, each with its own link and date. The order moved to Completed when the first was added; adding the second did not change it again.

The shortcode (full edition)

[gatemi_tracking order="123"] prints the tracking section for order 123 wherever you place it — but only for the signed-in customer who owns that order. An order id is a guessable number, so anybody else, and any guest, sees nothing.

Next: FAQ and troubleshooting.

Shopping Cart
Scroll to Top