In Woocommerce user can also create account in the checkout process. At this point, I am trying to add some extra fields (like Email, Password confirmation & checkbox for 'email me') if user select "Create an account?" checkbox (image attached for reference).
At present it only show "Create account password" fields. But I want to add 3 more fields after the "Create account password" like - password confirmation , Email confirmation & checkbox for email me.
How can i add this functionality? Which action hook should i have to use for storing the that data.
I've tried the following - : -
I used filter woocommerce_checkout_fields for adding the extra fields.It working but it only displaying the fields before the "Create an account" checkbox. I am following this link for adding the extra fields - add a custom checkout billing field under the last name in WooCommerce
i am using the following code to add confirm E-mail Text Box
add_filter('woocommerce_checkout_fields', 'custom_woocommerce_checkou_form_fields');
function custom_woocommerce_checkout_form_fields( $fields )
{
$fields['billing']['billing_email_cnfrm'] = array(
'label' => __('Please Confirm Email Address', 'woocommerce'), // Add custom field label
'placeholder' => __('Please Confirm Email Address', 'woocommerce'), // Add custom field placeholder
'required' => true, // if field is required or not
'clear' => false, // add clear or not
'type' => 'text', // add field type
'class' => array('form-row form-row-wide'), // add class name
);
}
Similarly I added the checkbox also - (Image attached)
Any Advice Please.