For discussing the development and usage of Checkout UI extensions, post-purchase extensions, web pixels, Customer Accounts UI extensions, and POS UI extensions
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>
);
}
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.