title: Enable confirmation password in Woocommerce checkout form
body: <p>I have enabled 'Enable customer registration on the "Checkout" page' this option in Woocommerce settings. New customer gets registered on website while placing order. There is no other means of registration.</p>
  
  <p><a href="https://dev.clipcertification.com/checkout/" rel="nofollow noreferrer">https://dev.clipcertification.com/checkout/</a></p>
  
  <p>While placing order, there is a field for password.
  I want to have 'Confirm Password', I tried using following code in theme's functions.php filr, but Confirm Password field do not show up.</p>
  
  <pre><code>&lt;?php
  // place the following code in your theme's functions.php file
  // Add a second password field to the checkout page.
  add_action( 'woocommerce_checkout_init', 'wc_add_confirm_password_checkout', 10, 1 );
  function wc_add_confirm_password_checkout( $checkout ) {
  if ( get_option( 'woocommerce_registration_generate_password' ) == 'no' ) {
      $checkout-&gt;checkout_fields['account']['account_password2'] = array(
          'type'              =&gt; 'password',
          'label'             =&gt; __( 'Confirm password', 'woocommerce' ),
          'required'          =&gt; true,
          'placeholder'       =&gt; _x( 'Confirm Password', 'placeholder', 'woocommerce' )
      );
  }
  }
  // Check the password and confirm password fields match before allow checkout 
  to proceed.
  add_action( 'woocommerce_after_checkout_validation', 
  'wc_check_confirm_password_matches_checkout', 10, 2 );
  function wc_check_confirm_password_matches_checkout( $posted ) {
  $checkout = WC()-&gt;checkout;
  if ( ! is_user_logged_in() &amp;&amp; ( $checkout-&gt;must_create_account || ! empty( 
  $posted['createaccount'] ) ) ) {
  if ( strcmp( $posted['account_password'], $posted['account_password2'] ) !== 
  0 ) {
  wc_add_notice( __( 'Passwords do not match.', 'woocommerce' ), 'error' );
      }
  }
  }
  ?&gt;
  </code></pre>