Join us for an upcoming Shopify Partner webinar on February 27, 2024. Discover the latest Checkout Extensibility features, and deep dive on improvements to Shopify Functions and Web Pixels. Register now for either the 10am EST or 2pm EST sessions.

How to make the checkbox extension required

Shopify Partner
24 0 4

Hi, I need to make a checkbox required before clicking on "Pay Now". How can I change this extension's code to make it required? Thank you!

import {render, Checkbox} from '@shopify/checkout-ui-extensions-react';
render('Checkout::Dynamic::Render', () => <Extension />);
function Extension() {
  return (
    <Checkbox id="checkbox" name="checkbox">
      Save this information for next time
Reply 1 (1)

Shopify Staff
246 57 67

Hi there 👋

I would recommend taking a look at this tutorial for adding validation to your Checkout UI Extension.

You will need to use the BuyerJourney Intercept to block the checkout progress if the checkbox is not checked.

To learn more visit the Shopify Help Center or the Community Blog.