Recipe: Set up delivery drivers

1. Create driver accounts

The plugin registers a driver WordPress role (subscriber capabilities) on every page load, so it is always available:

  1. WP Admin → Users → Add New (or edit an existing user).
  2. Set the role to Driver.

The role is also appended to the Product Vendors staff-role list (mam_wc_pv_staff_roles filter), so on Product Vendors sites a driver can be attached to a vendor as staff. Drivers attached to a vendor appear in that vendor’s Assign to Driver selector for delivery orders.

Any user whose roles include driver automatically gets the driver home screen in the app (PHP developers can extend this to other users by returning true from the mam_wc_delivery_driver_home_screen filter).


2. Punch in / punch out (on duty / off duty)

When a driver has no active trip, the home screen shows a single duty button:

  • Go on Duty — shown when the driver is not punched in for today.
  • Go off Duty — shown when the driver is punched in for today.

Tapping the button sends the mam_ride_share_driver_update app action, which toggles two user metas:

User meta Value
tsl_activity_user_is_punched_in 1 = on duty, 2 = off duty
tsl_activity_user_active_date the site-local date of the last punch

The punch state is informational for assignment: when a vendor opens the Assign to Driver selector, punched-in drivers are listed with an “(Available)” suffix. Punch state does not block claiming or assignment.

The image configured in Delivery settings → On Duty Image is displayed beneath the duty button (an Off Duty Image setting is also registered).

When the driver has an active trip (an order assigned to them in processing), the duty button is replaced by the trip-status button (Arrived at Pickup, Departed Pickup, …) plus a service-details map card — see Hook: mam_ride_share_driver_update.


3. How drivers claim orders

Orders waiting for a driver (order meta pending_driver_assigment set, no assigned_to_driver yet) appear on the available-orders board — the WC Delivery Available Orders content class. Add it to the app from the content manager; its view-controller type is offDirectory.

Privacy on the board:

  • Before a claim, browsing drivers see only an anonymous summary: pickup-location title, order number, order date/time, item count, and fees. Customer name, address, phone, email, GPS, and order total are withheld.
  • Vendor staff of the order and store managers (manage_woocommerce) see the full details at all times.

Tapping the order’s action button (the title comes from the order’s current transport stage, e.g. Assign to Driver) sends mam_check_in with the driver’s own ID as the selected driver. The claim rules:

  1. The acting user must have the driver role (resolved from the app token, never from request parameters).
  2. The order must still be unclaimed and awaiting a driver.
  3. A driver can only claim for themselves — assigning anyone else requires vendor staff or manager rights.
  4. The write of assigned_to_driver happens under a per-order atomic lock: if two drivers claim simultaneously, exactly one succeeds; the loser’s claim is rejected and the order disappears from their board on refresh.

After a successful claim the order moves to the driver’s open orders list (WC Delivery Open Orders), full customer details become visible to that driver, and the driver gets the mam_wc_delivery_new_order_for_delivery notification. Any “Driver Tip” / “Delivery Fee” fee lines are converted to the vendor’s tip/shipping products so payouts route correctly (Product Vendors sites).

Sites can loosen or tighten the claim rules with the mam_wc_delivery_user_can_claim_order filter — see Hooks: transport authorization.


4. Driver duty and assignment settings

Setting (Delivery tab) Effect on drivers
Order Assignment Minute(s) If no driver accepts within this many minutes, administrators are notified (wc-delivery-no-driver-accepted-order)
Tip % for Driver Portion of the order tip split out as a “Driver Tip” fee line
On Duty / Off Duty Image Home-screen artwork for the duty state

  • Plugin: mam-woocommerce-delivery
  • Recipe: Transport statuses and customer notifications
  • Hooks: transport authorization (mam_wc_delivery_user_can_manage_transport)
  • Hook: mam_ride_share_driver_update

Metadata

Field Value
Article type Recipe
Plugin slug mam-woocommerce-delivery
Applies to plugin version 1.4.1+
Category Building Your App
Audience App builder, store manager
Last verified 2026-06-10
Contents

    Need Support?

    Can't find the answer you're looking for? Don't worry we're here to help!