Module:Magenx_CheckoutFieldsGraphQl · storefront flag features.checkoutFields
Adds two optional fields to the checkout shipping step: an order comment, and a requested delivery date with an optional time slot. Staff see them on the order, in the order grid and in the order email.
Delivery date and comment on the checkout shipping step.
The shopper picks from dates the server calculates:
Lead time: the earliest date, in days from today. 0 allows same-day delivery.
Cut-off time: at or after this time, the earliest date moves one day later.
Weekdays without delivery, for example Sunday.
Closed dates, one YYYY-MM-DD per line.
Maximum window: the latest date, in days from today.
Time slots: optional code / label rows. Once any slot exists, the shopper must pick one with the date.
All dates are calendar dates in the store timezone (General > Locale Options > Timezone).
The date picker never shows for In-Store Pickup or for virtual orders.
The date is checked again when the order is placed. A cut-off can pass while the shopper is on a PayPal or 3-D Secure page, so an outdated date stops the order with “The delivery date … is no longer available. Please choose another date.” instead of recording a date you can’t meet.
Three variables are available in order email templates. They are empty when not set, and HTML in the comment is escaped. Add a block like this in Marketing > Email Templates:
Yes/No. Shows an optional "Order comment" box on the storefront checkout review step. The comment is shown on the admin order view and is available to the order email as {{var magenx_order_note}}.
Maximum Length magenx_checkout_fields/order_note/max_length
500
Store view
Text. Shown when Enabled = Yes. Longest comment accepted, in characters. Longer comments are rejected by the API.
Yes/No. Lets the shopper pick a delivery date (and a time slot, when slots are configured) after choosing a shipping method. Never offered for In-Store Pickup or for virtual orders.
Yes/No. Shown when Enabled = Yes. When Yes, an order cannot be placed without a delivery date. Agent checkouts (UCP / ACP) never send a date, so leave this at No if you sell through AI agents.
Minimum Lead Time (days) magenx_checkout_fields/delivery_date/lead_days
1
Store view
Text. Shown when Enabled = Yes. Earliest selectable date, in days from today (store time zone). 0 allows same-day delivery.
Maximum Days Ahead magenx_checkout_fields/delivery_date/max_days
30
Store view
Text. Shown when Enabled = Yes. Latest selectable date, in days from today. Capped at 365.
Daily Cut-off Time magenx_checkout_fields/delivery_date/cutoff_time
empty
Store view
Text. Shown when Enabled = Yes. 24-hour HH:MM in the store time zone, e.g. 14:00. Orders placed after it push the earliest date back one day. Leave empty for no cut-off.
No Delivery On magenx_checkout_fields/delivery_date/excluded_weekdays
0
Store view
Multiple select. Shown when Enabled = Yes. Weekdays on which you do not deliver.
Text area. Shown when Enabled = Yes. Holidays and other dates without delivery, one per line as YYYY-MM-DD. Invalid lines are ignored.
Time Slots magenx_checkout_fields/delivery_date/slots
empty
Store view
Text. Shown when Enabled = Yes. Optional delivery windows. When any are configured the shopper must pick one together with the date. "Code" must be unique and stable (e.g. "morning"); "Label" is shown to the shopper (e.g. "08:00 – 12:00").
setCheckoutFieldsOnCart changes only the fields you pass; null or "" clears one. Cart ownership is checked like every stock cart mutation. Cart.checkout_fields.delivery_options is null when delivery dates are off, the cart is virtual, or In-Store Pickup is selected.
Set or clear the order comment and the delivery date / time slot on a cart. A field left out of the input is unchanged; a field passed as null or an empty string is cleared.
Argument
Type
Description
input
SetCheckoutFieldsOnCartInput!
Fields added to Magento types
Field
Type
Description
Cart.checkout_fields
CartCheckoutFields
The order comment and delivery date settings and values for this cart.
CustomerOrder.checkout_fields
OrderCheckoutFields
The order comment and requested delivery date recorded on the order, or null when it has neither.
Types
input SetCheckoutFieldsOnCartInput - The checkout fields to store on a cart.
Field
Type
Description
cart_id
String!
The masked cart id.
order_note
String
Free-text order comment. HTML tags are stripped; rejected when longer than `CartCheckoutFields.order_note_max_length`.
delivery_date
String
Requested delivery date as YYYY-MM-DD. Must be one of `DeliveryOptions.available_dates`.
delivery_slot
String
The `code` of one of `DeliveryOptions.slots`. Required together with a date when slots are configured.
type SetCheckoutFieldsOnCartOutput - The updated cart.
Field
Type
Description
cart
Cart!
type CartCheckoutFields - Order comment and delivery date for a cart.
Field
Type
Description
order_note_enabled
Boolean!
Whether the order comment box is offered.
order_note_max_length
Int!
Longest order comment accepted, in characters.
order_note
String
The order comment stored on the cart.
delivery_date
String
The requested delivery date stored on the cart (YYYY-MM-DD).
delivery_slot
DeliverySlot
The requested time slot stored on the cart.
delivery_options
DeliveryOptions
The selectable delivery dates and slots. Null when delivery dates are disabled, the cart is virtual, or In-Store Pickup is the selected shipping method.
type DeliveryOptions - Selectable delivery dates and time slots, computed in the store time zone.
Field
Type
Description
required
Boolean!
Whether the order cannot be placed without a delivery date.
available_dates
[String!]!
Every selectable date (YYYY-MM-DD), ascending. Lead time, cut-off, excluded weekdays and closed dates are already applied.
slots
[DeliverySlot!]!
Time slots to choose from; empty when the merchant offers none.
type DeliverySlot - A delivery time window.
Field
Type
Description
code
String!
Stable identifier, sent back in `SetCheckoutFieldsOnCartInput.delivery_slot`.
label
String!
Shopper-facing label, e.g. "08:00 – 12:00".
type OrderCheckoutFields - Order comment and requested delivery date recorded on an order.