DeliveryOptionsModule
Delivery dates, time slots and pickup points on commercetools: listing them on the cart and choosing one, which sets the shipping method that charges for it, and reading the choice back on the order.
import { DeliveryOptionsModule } from "@evolve-framework/commercetools";Serves the Delivery options part of the GraphQL API: cartSetDeliveryPreference, cartSetDeliverySlot, cartSetPickupPoint.
new DeliveryOptionsModule(options: DeliveryOptionsModuleOptions)| Option | Type | Description |
|---|---|---|
customTypes | Pick<CustomTypeKeys, "order"> | Key of the custom type this project has provisioned for a cart, the same
one |
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: a provider without it makes no promises. |
shippingMethodDelivery? | ((request: ShippingMethodDeliveryRequest) => Promise<ShippingMethodDelivery>) | The carrier and delivery estimate of one shipping method, 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 medusa.

