title: Make last name field unique for guests on WooCommerce checkout
body: <p>I would like to make the entered values in last name field in checkout page unique or validate for duplicates.</p>
  <p>This is for guests users only where they fill the first name and last name. I currently have this snippet but this does not have the desired result. Any advice?</p>
  <pre class="lang-php prettyprint-override"><code>add_action( 'woocommerce_before_checkout_billing_form', 'lastname_field' );
  
  function validate_lastname_field($exist_error )  {
      global $wpdb;
      
      $billing_last_name = $_POST['billing_last_name'];
      $results = $wpdb-&gt;get_results('SELECT * FROM `abc_usermeta` where meta_key = &quot;billing_last_name&quot; AND meta_value = &quot;'.$billing_last_name.'&quot;');
      if ( $results ) {
          $exist_error-&gt;add( 'billing_last_name_error', __( 'Last name already exists.', 'woocommerce' ) );
      }
  
      return $exist_error;
  }
  </code></pre>