Skip to main content

Standard Production

This document covers the estimated arrival timeline logic for Made-to-Order (MTO) products displayed on PDPs and stored in cart attributes.

Overviewโ€‹

Estimated arrival dates communicate when customers can expect to receive their made-to-order items. Timelines are built by calculating a high end and low end of the date range:

  • High end: Production days converted to weeks (e.g., 56 days โ†’ 8 weeks)
  • Low end: (Production days - MTO delivery window) converted to weeks (e.g., 56 - 14 = 42 days โ†’ 6 weeks)

With these values, the displayed range would be: 6-8 weeks

Metafieldsโ€‹

custom.mto_delivery_window (Product Level)โ€‹

Controls the delivery window variance for individual products. Previously, the MTO Delivery Window was always defaulted to 14 days (Builder setting). This metafield allows overwriting the value on a per-product basis.

Metafield ValueBehaviorExample (56 production days)
Empty/undefinedFalls back to Builder site settings default (14 days)6-8 weeks
0Shows only the high end (no range)8 weeks
> 0 (e.g., 21)Shows a range using the window value5-8 weeks

custom.production_days (Product Level)โ€‹

The upper bound of when the customer will receive their order, in days from the order date. Falls back to siteSettings.dualSale.standardProductionDays if not set.

Timeline Calculationโ€‹

Week Range Display (PDP Option Selector)โ€‹

When mtoDeliveryWindow > 0:

Lower bound: Math.ceil((productionDays - mtoDeliveryWindow) / 7)
Upper bound: Math.ceil(productionDays / 7)
Display: "{lowerWeeks}-{upperWeeks} weeks"

When mtoDeliveryWindow === 0:

Display: "{Math.ceil(productionDays / 7)} weeks"

Note: Days are converted to weeks using Math.ceil() (rounds up to the nearest whole number).

Date Range Display (Estimated Arrival Title)โ€‹

When mtoDeliveryWindow > 0:

Lower date: today + (productionDays - mtoDeliveryWindow)
Upper date: today + productionDays
Display: "Get it {lowerDate} - {upperDate}"

When mtoDeliveryWindow === 0:

Display: "Get it {upperDate}"

Examplesโ€‹

When field is empty (uses default 14-day window)โ€‹

56 production days, no mto_delivery_window set

Metafield configuration

Since the MTO Delivery Window is empty, it defaults to Builder setting (14 days). A range is built:

  • High end: 56 days โ†’ 8 weeks
  • Low end: 56 - 14 = 42 days โ†’ 6 weeks
  • Result: 6-8 weeks

Result

When field is set to a numberโ€‹

56 production days, 21-day window

Metafield configuration

A range is built using the mto delivery window and the production days:

  • High end: 56 days โ†’ 8 weeks
  • Low end: 56 - 21 = 35 days โ†’ 5 weeks
  • Result: 5-8 weeks

Result

When field is set to 0โ€‹

56 production days, 0-day window

Metafield configuration

Setting the mto delivery window to 0 is a special case that causes only the high end of the range to appear:

  • High end: 56 days โ†’ 8 weeks
  • Result: 8 weeks

Result

Cart Attributesโ€‹

When adding MTO products to cart, the delivery window is stored in cart line item attributes:

{
key: "_MADE-TO-ORDER",
value: "Expected to arrive between 01-15-2025 and 01-29-2025"
}
// or when mtoDeliveryWindow === 0:
{
key: "_MADE-TO-ORDER",
value: "Expected to arrive 01-29-2025"
}

Date format: MM-dd-yyyy

Resolution Logicโ€‹

The system resolves the delivery window value using this priority:

// mtoDeliveryDays = value from custom.mto_delivery_window metafield
const resolveMtoDeliveryWindow = (mtoDeliveryDays, defaultDeliveryWindow) => {
return mtoDeliveryDays !== undefined && !Number.isNaN(mtoDeliveryDays)
? mtoDeliveryDays
: defaultDeliveryWindow;
};
  1. If product has valid mto_delivery_window metafield โ†’ use product value
  2. Otherwise โ†’ use Builder site settings default (siteSettings.dualSale.mtoDeliveryWindow)

Hydrogen Storefrontโ€‹

  • app/components/EstimatedArrivalOption/estimatedArrivalOption.component.tsx - Radio option display
  • app/components/ProductOptions/estimatedArrivalTitle.component.tsx - Title with date tooltip
  • app/components/ProductOptions/utils.tsx - Timeline calculation utilities
  • app/lib/cart.ts - Cart attribute generation
  • app/graphql/storefront/ProductQuery.ts - GraphQL query for metafield

Builder.io Site Settingsโ€‹

  • siteSettings.dualSale.mtoDeliveryWindow - Default delivery window in days (default: 14)
  • siteSettings.dualSale.standardProductionDays - Default production days (default: 56)