show div после регистра процесса, woocommerce

после регистрации на веб-сайте я хочу показать скрытый div, который находится на одной странице. но после регистрации страница загрузится и отобразит одну и ту же страницу.

вот форма-handler.php

public static function process_registration() { $nonce_value = isset( $_POST['_wpnonce'] ) ? $_POST['_wpnonce'] : ''; $nonce_value = isset( $_POST['woocommerce-register-nonce'] ) ? $_POST['woocommerce-register-nonce'] : $nonce_value; if ( ! empty( $_POST['register'] ) && wp_verify_nonce( $nonce_value, 'woocommerce-register' ) ) { $username = 'no' === get_option( 'woocommerce_registration_generate_username' ) ? $_POST['username'] : ''; $password = 'no' === get_option( 'woocommerce_registration_generate_password' ) ? $_POST['password'] : ''; $email = $_POST['email']; try { $validation_error = new WP_Error(); $validation_error = apply_filters( 'woocommerce_process_registration_errors', $validation_error, $username, $password, $email ); if ( $validation_error->get_error_code() ) { throw new Exception( $validation_error->get_error_message() ); } // Anti-spam trap if ( ! empty( $_POST['email_2'] ) ) { throw new Exception( __( 'Anti-spam field was filled in.', 'woocommerce' ) ); } $new_customer = wc_create_new_customer( sanitize_email( $email ), wc_clean( $username ), $password ); if ( is_wp_error( $new_customer ) ) { throw new Exception( $new_customer->get_error_message() ); } if ( apply_filters( 'woocommerce_registration_auth_new_customer', true, $new_customer ) ) { wc_set_customer_auth_cookie( $new_customer ); } wp_safe_redirect( apply_filters( 'woocommerce_registration_redirect', wp_get_referer() ? wp_get_referer() : wc_get_page_permalink( 'myaccount' ) ) ); exit; } catch ( Exception $e ) { wc_add_notice( '<strong>' . __( 'Error', 'woocommerce' ) . ':</strong> ' . $e->getMessage(), 'error' ); } } } 

и div

 <div class="alert success"> <span class="closebtn">&times;</span> <strong>Registration Success!</strong> Check Email. </div> 

и это код js

  jQuery('input.btn.btn-default.size-new-account').click(function() { jQuery('.alert.success').show(); }); 

но проблема, как я могу понять поток для регистрации, и я могу использовать условие или по-другому. поэтому в уведомлении будет показано, успешна ли проверка, а также отображать после загрузки страницу.

После обработки вашей регистрации (php-код) выполните следующую строку

 wc_add_notice('Registration successful') ; 

Тогда вам не нужен новый div