Add terms checkbox
<?php
add_filter('pre_option_woocommerce_default_gateway' . '__return_false', 99);
add_action('woocommerce_review_order_before_submit', 'suite7_add_checkout_privacy_policy', 9);
function suite7_add_checkout_privacy_policy()
{
woocommerce_form_field('terms_and_conditions', array(
'type' => 'checkbox',
'class' => array('form-row privacy wc-terms-and-conditions'),
'label_class' => array('woocommerce-form__label woocommerce-form__label-for-checkbox checkbox'),
'input_class' => array('woocommerce-form__input woocommerce-form__input-checkbox input-checkbox'),
'required' => true,
'label' => 'Ik ga akkoord met de <a href="'.get_permalink(get_page_by_path('algemene-voorwaarden')).'">algemene voorwaarden</a> en de <a href="'.get_permalink(get_page_by_path('leveringsvoorwaarden')).'">leveringsvoorwaarden</a>',
));
}
add_action('woocommerce_checkout_process', 'suite7_not_approved_privacy');
function suite7_not_approved_privacy()
{
if (! (int) isset($_POST['terms_and_conditions'])) {
wc_add_notice(__('U moet akkoord gaan met onze leveringsvoorwaarden.'), 'error');
}
}