mam_wc_delivery_request_driver — external dispatch hand-off
Signature
apply_filters( 'mam_wc_delivery_request_driver', string $transport_status, int $order_id );
| Parameter | Type | Description |
|---|---|---|
$transport_status |
string |
Always 'driver_assigned' when fired; return the (possibly updated) status. |
$order_id |
int |
The order to dispatch. |
What it does
Fired from the Assign to Driver rung when the selected request value is non-numeric (i.e. the chooser picked an external service rather than a user). The caller must already have passed the manager/vendor-staff authorization. A delivery-service integration hooks this filter, creates the third-party delivery, and stores its linkage on the order:
add_filter( 'mam_wc_delivery_request_driver', function ( $transport_status, $order_id ) {
$delivery_id = my_service_create_delivery( $order_id );
$order = wc_get_order( $order_id );
$order->update_meta_data( 'my_service_delivery_id', $delivery_id );
$order->save();
return $transport_status;
}, 10, 2 );
mam-doordash-delivery is the reference consumer. The integration reports progress back by walking the same ladder server-side:
do_action( 'mam_wc_delivery_set_delivery_status', $order_id, 'driver_assigned' ); // advance
A failed/cancelled dispatch should fire do_action( 'mam_wc_delivery_driver_assignment_failed', $order_id ) (or pass status cancelled_by_doordash to mam_wc_delivery_set_delivery_status, which also rolls the order back to prep_started); both notify the vendor admins and administrators via wc-delivery-delivery-assignment-failed.
mam_wc_delivery_start_order — order-due-to-start cron task
Signature
apply_filters( 'mam_wc_delivery_start_order', array $result );
| Parameter | Type | Description |
|---|---|---|
$result |
array |
The cron task record; the handler sets last_run and status and returns it. Non-array invocations are ignored. |
Registered with the MAM cron manager as MAM WC Delivery – Start Order. Frequency = the Order Due to Start Notification Time setting (tsl-setting-deliver_driver_start_order_notification_minutes, clamped 1–1440, default 5). Each run finds processing orders whose delivery_date_formatted is today (site timezone) and whose delivery_time_range falls within the next N minutes, then sends wc-delivery-order-due-to-start to the order’s vendor admins (replacements: order_id, delivery_time).
Hook it (at a later priority, returning $result) to piggyback custom “shift starting” logic on the same schedule.
mam_wc_delivery_no_driver_accepted — stale-assignment cron task
Signature
do_action( 'mam_wc_delivery_no_driver_accepted', array $result );
| Parameter | Type | Description |
|---|---|---|
$result |
array |
The cron task record (the handler returns it with last_run/status for the cron manager). Calls without an array are ignored. |
Registered with the MAM cron manager as MAM WC Delivery – No Driver Accepted. Frequency = the Order Assignment Minute(s) setting (tsl-setting-deliver_driver_assignment_minutes, clamped 1–1440, default 5). Each run finds processing orders where pending_driver_assigment exists and pending_driver_assigment_time is older than N minutes, and sends wc-delivery-no-driver-accepted-order to every administrator.
Related articles
- Recipe: Transport statuses and customer notifications
- Hooks:
mam_check_inand order advancement - Plugin: mam-woocommerce-delivery
Metadata
| Field | Value |
|---|---|
| Article type | Hook Reference |
| Plugin slug | mam-woocommerce-delivery |
| Applies to plugin version | 1.4.1+ |
| Category | Extending MAM Suite |
| Hook type | mam_wc_delivery_request_driver: filter · mam_wc_delivery_start_order: filter (cron) · mam_wc_delivery_no_driver_accepted: action (cron) |
| Audience | PHP developer |
| Last verified | 2026-06-10 |
