Skip to content

Local Delivery Routes

The ext_local_delivery_routes extension adds named driver delivery runs (for example "Tuesday East Valley") as checkout shipping options: it registers a shipping strategy under the carrier code local_delivery that quotes one rate per enabled route the cart qualifies for, each with a flat cost and a minimum-order threshold. The route's scheduling message rides along on the rate so checkout can show delivery-day info, and drivers get a manifest of the orders that chose local delivery. Use it when you run your own local delivery routes instead of (or alongside) parcel carriers.

At a glance

Extension id local_delivery_routes
Category shipping
Version 0.1.0
Provides Shipping carrier strategy (local_delivery), route model, GraphQL query + mutations, migrations
External account None

What It Provides

  • A ShippingCalculatorStrategy registered as local_delivery (see Building Extensions for the strategy surface). At quote time it loads every enabled DeliveryRoute, drops routes whose minimum order amount exceeds the cart value, and returns one rate per qualifying route:

    Method code Method name Rate
    local_delivery_<route id> The route's display name The route's flat cost

When a route has a message, it is attached to the rate's warnings so checkout can surface scheduling info. - Route model — the extension owns the ext_local_delivery_routes_routes table (DeliveryRoute), self-registered via the manifest's models() hook and created by the extension's own migrations. - GraphQL admin CRUD — query deliveryRoutes lists all routes and mutations saveDeliveryRoute / deleteDeliveryRoute manage them (all guarded by the settings.edit permission). - Driver manifest — query localDeliveryOrders(statuses: [String!]) returns fulfillable orders whose shipping method starts with local_delivery (guarded by order.view); it defaults to the statuses paid, processing, fulfilling, and awaiting_payment and returns order number, status, shipping method, grand total, and delivery city/postal code.

Setup

  1. Once installed (or dev-linked in development), the extension is discovered at startup. Per-channel enablement is managed under Settings > Extensions. Its migrations create the routes table.
  2. Create a shipping provider with carrier code local_delivery under Settings > Shipping > Providers, and assign its method to a shipping zone under Settings > Shipping > Zones.
  3. Create one or more routes via the saveDeliveryRoute mutation (name, storefront display name, optional message, flat cost, minimum order amount, enabled flag).
  4. Grant local delivery to the assigned accounts with a grant rule on subject local_delivery — customers not assigned to delivery never see the methods (this replaces the source store's per-user usermeta flags).

See Shipping & Fulfillment for the provider / zone / method model.

Configuration Reference

The manifest declares no config_schema; there are no extension-level settings. Per-route settings live on the DeliveryRoute rows, edited through the GraphQL mutations:

Field Type Default Description
name string (required) Internal route name (e.g. "Tue East")
display_name string (required) Storefront-facing method name
message string (none) Scheduling note shown as a checkout rate warning
cost decimal 0 Flat delivery cost quoted for the route
min_order_amount decimal 0 Minimum cart value before the route is offered
enabled boolean true Whether the route is quoted

Operational Notes

  • Cart-value gate — cart value is summed from package line items (price × quantity); a route is skipped when the cart value is below its min_order_amount.
  • One rate per qualifying route — each enabled, qualifying route becomes a distinct checkout method keyed local_delivery_<route id>.
  • Opt-in access — access is gated per account/customer/group via a grant rule on subject local_delivery; unassigned shoppers never see the methods.
  • Manifest is read-onlylocalDeliveryOrders reports orders for the driver; it does not change order state.

Source: ext_local_delivery_routes/extension.py — in the enterprise-extensions repo.