DeliveryOptionsModule
Delivery dates, time slots and pickup points on Medusa: listing them on the cart and choosing one, which sets the shipping option that charges for it, and reading the choice back on the order.
import { DeliveryOptionsModule } from "@evolve-framework/medusa/modules";Serves the Delivery options part of the GraphQL API: cartSetDeliveryPreference, cartSetDeliverySlot, cartSetPickupPoint.
new DeliveryOptionsModule(options: DeliveryOptionsModuleOptions)| Option | Type | Description |
|---|---|---|
provider | DeliveryOptionsProvider | Where the delivery dates and slots come from:
|
pickupPoints? | PickupPointProvider | Where pickup points come from: |
DeliveryOptionsProvider4The fields of provider.
| Field | Type | Description |
|---|---|---|
deliveryDates | (request: DeliveryRequest, range: { from?: string | undefined; days: number; }) => Promise<DeliveryDate[]> | Every date from |
findSlot | (request: DeliveryRequest, slotId: string) => Promise<DeliverySlotChoice | undefined> | The slot a client chose, checked again against the cart; undefined when unknown. |
deliveryPromise? | ((request: DeliveryPromiseRequest) => Promise<DeliveryPromise>) | The earliest delivery of one variant to one place, for a product page. Optional: Medusa prices shipping options only for a cart, so the schedule makes no promises, and a provider without it leaves the field null. |
shippingMethodDelivery? | ((request: ShippingMethodDeliveryRequest) => Promise<ShippingMethodDelivery>) | The carrier and delivery estimate of one shipping option, for the delivery step. Optional: a provider without it leaves both null. |
PickupPointProvider2The fields of pickupPoints.
| Field | Type | Description |
|---|---|---|
pickupPoints | (request: DeliveryRequest, query: PickupPointQuery) => Promise<PickupPoint[]> | Points matching the query, nearest first when a position was given. |
findPickupPoint | (request: DeliveryRequest, pickupPointId: string) => Promise<PickupPointChoice | undefined> | The point a client chose, checked again against the cart; undefined when unknown. |
Extends AbstractModule<unknown>.
The same module on commercetools.

