title: Add a second checkbox in WooCommerce registration form
body: <p>How could I add a second checkbox in the registration form for WooCommerce users?</p>
  <p>On the 'my account' page of WooCommerce it gives you the option to log in or register (that's where I need help).</p>
  <p>I already have a checkbox established to accept the privacy policy (just below the user, e-mail and password boxes).</p>
  <p>This is the hook that I have achieved thanks to this <a href="https://www.enriquejros.com/formulario-registro-woocommerce-rgpd/" rel="nofollow noreferrer">article</a></p>
  <pre><code>add_action( 'woocommerce_register_form', function () {
    
    woocommerce_form_field( 'politica_privacidad_registro', array(
        'type'          =&gt; 'checkbox',
        'class'         =&gt; array('form-row rgpd'),
        'label_class'   =&gt; array('woocommerce-form__label woocommerce-form__label-for-checkbox checkbox'),
        'input_class'   =&gt; array('woocommerce-form__input woocommerce-form__input-checkbox input-checkbox'),
        'required'      =&gt; true,
        'label'         =&gt; 'He leído y acepto la política de privacidad',
        )); 
  }, 10);
  
  add_filter( 'woocommerce_registration_errors', function ( $errores, $usuario, $email ) {
      if ( ! (int) isset( $_POST['politica_privacidad_registro'] ) ) {
          $errores-&gt;add( 'politica_privacidad_registro_error', 'Tienes que aceptar nuestra política de privacidad' );
      }
  return $errores;
  }, 10, 3);
  </code></pre>
  <p>But I need another checkbox so that they accept another necessary requirement on the web (age verification).
  That mandatory age verification checkbox to register, of course, would be accompanied by a small phrase.</p>
  <p>I have tried with some hook in the <code>functions.php</code>, but it happens that if you accept the privacy checkbox you could already register even if you do not accept the second mandatory checkbox.</p>
  <p>This is the code that best suited what I needed <a href="https://stackoverflow.com/questions/58366386/add-a-age-verification-checkbox-in-woocommerce-registration-form">to this post</a></p>
  <pre class="lang-php prettyprint-override"><code>// To add the form
  function add_age_verification() {
      ?&gt;
  
      &lt;p class=&quot;form-row form-row-first&quot;&gt;
      &lt;label for=&quot;reg_age_verification&quot; class=&quot;woocommerce-form__label woocommerce-form__label-for-checkbox&quot;&gt;&lt;?php _e( 'age verification', 'woocommerce' ); ?&gt; &lt;span class=&quot;required&quot;&gt;*&lt;/span&gt;&lt;/label&gt;
      &lt;input type=&quot;checkbox&quot; class=&quot;woocommerce-form__input woocommerce-form__input-checkbox&quot; name=&quot;age_verification&quot; id=&quot;reg_age_verification&quot; value=&quot;&lt;?php if ( ! empty( $_POST['age_verification'] ) ) esc_attr_e( $_POST['age_verification'] ); ?&gt;&quot; /&gt;
      &lt;/p&gt;
  
      &lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
  
      &lt;?php
  }
    // to validate the form
  function validate_age_verification( $errors, $username, $email ) {
      if ( isset( $_POST['age_verification'] ) &amp;&amp; empty( $_POST['age_verification'] ) ) {
          $errors-&gt;add( 'age_verification_error', __( '&lt;strong&gt;Error&lt;/strong&gt;: First name is required!', 'woocommerce' ) );
      }
      return $errors;
  }
  
   // to save the form into user meta age_verification
  function age_verification_save( $customer_id ) {
      if ( isset( $_POST['age_verification'] ) ) {
          update_user_meta( $customer_id, 'age_verification', sanitize_text_field( $_POST['age_verification'] ) );
     }
  }
  
  add_action( 'woocommerce_register_form', 'add_age_verification' );
  add_filter( 'woocommerce_registration_errors', 'validate_age_verification', 10, 3 );
  add_action( 'woocommerce_created_customer', 'age_verification_save' );
  </code></pre>
  <p>Aside from the incompatibility of hooks, also this second checkbox with the tests that I have carried out appears the phrase in a line and the check box below. It must all go together on one line.</p>
  <p>How could I do it and have both hooks work without creating incompatibilities?</p>