Skip to main content

Terms Checkbox

TermsCheckbox renders checkout terms acceptance and tells the checkout store whether terms are accepted.

When To Use This Family​

Use this component inside checkout when the store requires customers to accept terms before placing an order.

Quick Start​

Checkout terms checkbox
<OmeWooTermsCheckbox
content='{{"label":"I agree to the terms and conditions","required_message":"Please accept the terms to place your order."}}'
/>

Component​

Component keyRole
OmeWooTermsCheckboxRenders the terms checkbox, optional label slot, and checkout terms state.

Props​

PropMeaning
content.labelLabel text when using component-managed label copy.
content.required_messageLocal error message when terms are required but unchecked.
accessibility.aria_labelAccessible checkbox label.

The component also accepts a default slot, so authors can put richer terms copy next to the checkbox.

Runtime Behavior​

The runtime binds input[data-ome-woo-terms-checkbox] and updates the checkout store:

Store flagMeaning
terms_requiredCheckout should block if the checkbox is unchecked.
terms_acceptedCurrent checkbox state.

When terms are required and unchecked, WooCheckoutStore.submit() emits a local terms_required error, sets checkout state to error, and CheckoutNotices renders the message. The message is translatable (OME_WOO.messages.termsRequired).

Accessibility​

  • If the default slot is empty and the checkbox has no aria-label or aria-labelledby, the runtime adds the store's own terms checkbox text (WooCommerce > Settings > Advanced > Page setup, placeholders resolved, plain text) as the label.
  • On a terms_required error, the checkbox gets aria-invalid="true". Its aria-describedby links to an error element ([data-ome-woo-terms-error]) placed after the label, and focus moves to the checkbox. Your own aria-describedby ids are kept.