Adding confirm password field to the checkout page causes Taxes stuck on loading
-
Hi there,
I’m using the following code to add a confirm password field to the checkout page. After the latest WordPress/Woocommerce updates this code seems to cause the Taxes tables, located in the Woocommerce admin settings, to stuck on “loading…”. Could you please help me to figure out what’s wrong? Thanks
// ----- Validate confirm password field match to the checkout page function lit_woocommerce_confirm_password_validation( $posted ) { $checkout = WC()->checkout; if ( ! is_user_logged_in() && ( $checkout->must_create_account || ! empty( $posted['createaccount'] ) ) ) { if ( strcmp( $posted['account_password'], $posted['account_confirm_password'] ) !== 0 ) { wc_add_notice( __( 'Password not matching.', 'woocommerce' ), 'error' ); } } } add_action( 'woocommerce_after_checkout_validation', 'lit_woocommerce_confirm_password_validation', 1, 2 ); // ----- Add a confirm password field to the checkout page function lit_woocommerce_confirm_password_checkout( $checkout ) { if ( get_option( 'woocommerce_registration_generate_password' ) == 'no' ) { $fields = $checkout->get_checkout_fields(); $fields['account']['account_confirm_password'] = array( 'type' => 'password', 'label' => __( 'Confirm password', 'woocommerce' ), 'required' => true, 'placeholder' => _x( 'Confirm Password', 'placeholder', 'woocommerce' ) ); $checkout->__set( 'checkout_fields', $fields ); } } add_action( 'woocommerce_checkout_init', 'lit_woocommerce_confirm_password_checkout', 1, 1 );
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Adding confirm password field to the checkout page causes Taxes stuck on loading’ is closed to new replies.