Skip to main content

Checkout Shell

The checkout shell owns checkout scope, form serialization, notices, and order submission.

When To Use This Family​

Use this family for the main checkout surface. It provides the checkout state scope, owns checkout form submission, renders checkout notices, and provides the submit button.

Quick Start​

Checkout provider and form
<OmeWooCheckoutProvider>
{#slot default}
<OmeWooCheckoutForm>
{#slot default}
<OmeWooBillingAddressForm />
<OmeWooShippingAddressForm />
<OmeWooPaymentMethodSelector />
<OmeWooTermsCheckbox />
<OmeWooCheckoutNotices />
<OmeWooPlaceOrderButton />
{/slot}
</OmeWooCheckoutForm>
{/slot}
</OmeWooCheckoutProvider>

Components​

Component keyRole
OmeWooCheckoutProviderLayout and state scope for checkout components. It does not submit data.
OmeWooCheckoutFormReal checkout form shell. Serializes authored checkout fields and submits Store API checkout.
OmeWooCheckoutNoticesCheckout notice region.
OmeWooPlaceOrderButtonSubmit button for the checkout form.

Authoring Structure​

CheckoutProvider
CheckoutForm
BillingAddressForm
ShippingAddressForm
ShippingMethodSelector
PaymentMethodSelector
TermsCheckbox
CheckoutNotices
PlaceOrderButton
OrderSummary

OrderSummary can sit inside the provider but does not have to be inside the <form>.

CheckoutProvider​

CheckoutProvider provides a stable checkout root and state scope. It is the preferred wrapper for full checkout layouts because CheckoutForm uses the closest provider as its serialization scope.

Empty Cart State​

Once the Store API cart has loaded with no items, the provider switches data-ome-state from idle to empty and reveals its [data-ome-woo-checkout-empty] region. It switches back to idle when items arrive. A cart that has not loaded yet is never treated as empty, and the Order Received page is excluded.

  • The empty slot holds your own empty-cart content. Turn on preview.empty_state to show it in the builder.
  • When the empty slot is unused, the runtime shows a default message and a "Return to shop" link (OME_WOO.messages.checkoutEmpty, OME_WOO.messages.returnToShop, OME_WOO.shopUrl).
  • PlaceOrderButton stays disabled while the loaded cart is empty.
  • By default your checkout content stays visible. Style [data-ome-woo-checkout-provider][data-ome-state="empty"] to change that, or turn on behavior.hide_form_when_empty.

Turn on behavior.hide_form_when_empty to hide everything in the provider except the empty-cart region while the loaded cart is empty. The runtime sets hidden on the provider's other direct children (they leave the layout and can't be focused) and shows them again when the cart gets items. Children you hid yourself stay hidden. If focus was inside the hidden content, it moves to the empty-cart region. The option is off by default, the builder keeps showing your form, and the Order Received page is not affected.

PropMeaning
preview.empty_stateShows the empty-cart slot in the Etch builder.
behavior.hide_form_when_emptyHides the rest of the checkout while the loaded cart is empty. Off by default.

CheckoutForm​

CheckoutForm:

  • Serializes all [data-ome-woo-checkout-field] controls inside the provider or form scope.
  • Copies billing to shipping when the different-shipping toggle is unchecked.
  • Runs local validation before submit.
  • Persists field changes with Store API update requests.
  • Submits checkout through Store API.
  • Dispatches checkout lifecycle events.
  • Redirects when the Store API payment result returns a redirect URL.

Form state is mirrored as data-ome-state: idle, loading, updating, processing, success, or error.

Checkout lifecycle integrations should listen for the checkout events documented in Woo Custom Events: ome-woo:checkout-loaded, ome-woo:checkout-started, ome-woo:checkout-complete, and ome-woo:checkout-error.

CheckoutNotices Props​

PropMeaning
preview.show_in_builderShows a sample notice in Etch builder preview.
preview.notice_typePreview notice type.
accessibility.aria_labelNotice region accessible label.
accessibility.live_regionLive region politeness.

PlaceOrderButton Props​

PropMeaning
content.labelButton text.
accessibility.aria_labelAccessible label.

PlaceOrderButton subscribes to checkout store state and disables itself while checkout is busy or the loaded cart is empty.