Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

How to make the checkbox extension required

How to make the checkbox extension required

a_zelinsky
Shopify Partner
26 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
    </Checkbox>
  );
}
Reply 1 (1)

lizk
Shopify Staff
246 58 77

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.