Recipe: Set up a ride-share service

1. Install the stack

Activate, in this order: MAM Main, WooCommerce, MAM WooCommerce (1.9.1+), Gravity Forms, WooCommerce Product Vendors (plus MAM WC Product Vendors), and — if pickups/destinations should be selectable from directory listings — GeoDirectory. The plugin lists these on the MAM required-plugins screen, and registers nothing app-facing until WooCommerce is active.

Then set up the Mapbox token (Recipe: Mapbox and geocoding setup) — bookings cannot compute routes without it.


2. Create the two Gravity Forms

The plugin registers two form definitions in the MAM Gravity-Forms settings (option root mam_wc_ride_share_). For each, create the Gravity Form, then map the form and its fields in the MAM settings so the saved options point at the right form/field ids.

Order Ride Share (option mam_wc_ride_share_ride_share) — field mappings (mam_wc_ride_share_ride_share_<slug>):

Field Slug Notes
Pickup Selector pickup_selector Choice field; the values Current Location and Enter Address are recognized — anything else selects a pickup listing
Pickup Location current_location GeoDirectory listing picker (used when not entering an address)
Pickup Address pickup_address Address field with Street / City / State / Zip inputs
Destination Selector dest_selector Choice field; Enter Address switches to manual entry
Destination Location dest_location GeoDirectory listing picker
Destination Address dest_address Address field with Street / City / State / Zip inputs
Departure Time departure-time e.g. Now or a “+N minutes” style increment
Credit Card credit-card Hidden automatically on manager-assigned rides
Driver ID driver_id Hidden field; pre-seeded by the manager “Assign” flow

Invite Driver (option mam_wc_ride_share_invite_driver) — fields driver-email and message.

The booking handler is only hooked once the form id option is set, so an unmapped form simply does nothing.


3. Create vendor (fleet) accounts

Each fleet/manager is a Product Vendors vendor term. On the vendor edit screen the plugin adds three fields:

Field Purpose
Trip Zip Codes Comma-separated zips the fleet services. A booking matches only when both the pickup zip and the destination zip are in this list. (Developers can bypass with the mam_wc_ride_share_ignore_zip_codes filter.)
Manager PV Account For driver sub-accounts: the manager vendor this driver belongs to.
Driver Tip Percentage Share of a rider tip paid to the driver (the rest stays with the vendor).

A hidden “Trip” product is created automatically per vendor on first use (price 0, commission from the Product Vendors default or mam_wc_pv_master_vendor_tip_commission_percent). You do not need to create products by hand.


4. Enroll drivers

From the app, a manager (role wc_product_vendors_admin_vendor) opens the Invite Driver form. The invitee gets an email with the manager’s six-digit enrollment code; registering in the app with that code (client_code) attaches the new user to the manager’s vendor account (parent_pv_account_id user meta) and assigns the driver role wc_product_vendors_manager_vendor.

Roles used throughout (also seeded by the setup wizard): customer = Rider, wc_product_vendors_manager_vendor = Driver, wc_product_vendors_admin_vendor = Manager.


5. How a booking matches a driver

  1. The rider’s home screen shows “Order Ride” only when at least one on-duty driver is within 10 miles (straight-line) of the rider’s GPS position.
  2. On submit, the pickup and destination are resolved to addresses (listing data or the entered address, geocoded via Mapbox).
  3. Vendors whose Trip Zip Codes cover both zips are considered; their on-duty drivers are ranked by Mapbox routing distance from the rider; the nearest wins.
  4. A WooCommerce order is created (processing), the destination becomes the order’s shipping address, the driver gets the wc-rs-new-trip notification, and the mam_wc_ride_share_order_created action fires.

If no vendor covers the zips the rider sees “This pickup location is not supported.” / “This destination is not supported.”; if no matched driver is on duty, “There are no drivers available at the moment for this trip.”

A manager using the Assign button on the driver directory bypasses steps 1–3 for the chosen driver (no zip match, no distance billing, no credit-card field).


6. Configure notifications and fares

  • Add message templates for the eight wc-rc-* / wc-rs-* notification slugs (see the plugin overview).
  • Decide whether rides are charged — see Recipe: Configure ride fares. Out of the box rides are tip-only.

  • Plugin: mam-woocommerce-ride-share
  • Recipe: Configure ride fares
  • Recipe: Mapbox and geocoding setup
  • Recipe: Driver home screen and duty toggle
  • Hook: get_available_drivers_for_lat_lon

Metadata

Field Value
Article type Recipe
Plugin slug mam-woocommerce-ride-share
Applies to plugin version 1.3.1+
Category Building Your App
Audience App builder
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!