Gatemi Shipment Tracking Developer Reference

The free edition applies no filters of its own. The filters, the shortcode and the options below are the full edition's; the order meta is shared by both.

Filters — Full edition

gmst_carriers

The carrier catalog: the built-in carriers merged with the ones saved on the screen, as slug ⇒ array( 'name' => …, 'url' => … ). Put {tracking} in the URL where the number belongs; an empty URL shows the number as plain text.

add_filter( 'gmst_carriers', function ( $carriers ) {
	$carriers['evri'] = array(
		'name' => 'Evri',
		'url'  => 'https://www.evri.com/track/parcel/{tracking}',
	);
	return $carriers;
} );

The number is rawurlencode()d before it replaces {tracking}.

gmst_tracking_html

The rendered tracking section, before it is shown on My Account, the order-received page, an HTML email or the shortcode.

Argument Type
$html string The section's markup
$order WC_Order The order
$shipments array The order's shipments

gmst_settings, gmst_modules, gmst_license_api_url, gmst_update_cache_ttl

The merged settings array, the boot module list, the gatemi.com licensing endpoint (for staging mirrors) and how long the update payload is cached.

Actions — Full edition

gmst_booted

Fires once the plugin has booted, with its service container.

Storage

Order meta (both editions)

_gmst_shipments — a list of shipments:

array(
	array( 'number' => '1Z999AA10123456784', 'carrier' => 'ups', 'date' => '2026-08-15' ),
	array( 'number' => 'JD014600003828', 'carrier' => 'dhl_express', 'date' => '' ),
)

Numbers have whitespace removed, carriers are sanitize_key()d, dates are YYYY-MM-DD or empty, and the same number never appears twice. Read and write it with $order->get_meta() / $order->update_meta_data() so it works under HPOS. The free edition reads and writes the first entry and keeps the rest.

// Add a shipment from your own fulfilment code.
$order     = wc_get_order( 1234 );
$shipments = (array) $order->get_meta( '_gmst_shipments', true );
$shipments[] = array( 'number' => 'JD014600003828', 'carrier' => 'dhl_express', 'date' => gmdate( 'Y-m-d' ) );
$order->update_meta_data( '_gmst_shipments', $shipments );
$order->save();

Options — Full edition

Option
gmst_settings in_emails, in_account, advance_status, shipped_status, heading
gmst_carriers Carriers saved on the screen, slug ⇒ name and URL
gmst_license Licence state

The free edition has no options.

Shortcode — Full edition

[gatemi_tracking order="123"] — the tracking section for one order, shown only to the signed-in customer who owns it. Returns nothing for a guest, another customer, or an order without shipments.

WooCommerce hooks used

Hook
woocommerce_order_details_after_order_table The section on My Account and the order-received page
woocommerce_email_order_details (priority 20) The section in customer emails
add_meta_boxes, woocommerce_process_shop_order_meta, save_post_shop_order The order box and its save, on both order screens

The order box saves only for users who can edit_shop_orders, with a nonce (gmstf_order_panel free, its own in the full edition).

CSS classes

The stylesheet loads only on My Account and the order-received page.

Free edition Full edition Element
.gmstf-tracking .gmst-tracking The section
.gmstf-tracking-title .gmst-tracking-title Its heading
.gmstf-shipment .gmst-shipments / .gmst-shipment The shipment (full edition: a list of them)
.gmstf-shipment-carrier .gmst-shipment-carrier The carrier name
.gmstf-shipment-number .gmst-shipment-number The number (a link when the carrier has one)
.gmstf-shipment-date .gmst-shipment-date "shipped …"

The class names differ between the editions, so a custom style written for one needs adding for the other.

Shopping Cart
Scroll to Top