Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/registration issue #1797

Merged
merged 21 commits into from
Aug 13, 2024
14 changes: 8 additions & 6 deletions assets/js/account.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 8 additions & 6 deletions assets/src/js/public/components/register-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@ jQuery(($) => {
console.log( response );
if( response.success ) {
$('.directorist-register-error').hide();
if( response.redirect_url ) {
$('.directorist-register-error').empty().show().append( response.redirect_message ).css({
'color' : '#009114',
'background-color': '#d9efdc'
});
if( response.data.redirect_url ) {
if( response.data.redirect_message ) {
$('.directorist-register-error').empty().show().append( response.data.redirect_message ).css({
'color' : '#009114',
'background-color': '#d9efdc'
});
}
setTimeout(function () {
window.location.href = response.redirect_url;
window.location.href = response.data.redirect_url;
}, 500)
}
} else {
Expand Down
6 changes: 3 additions & 3 deletions includes/classes/class-user.php
Original file line number Diff line number Diff line change
Expand Up @@ -231,15 +231,15 @@ public function directorist_register_form() {
'redirect_url' => esc_url_raw( ATBDP_Permalink::get_reg_redirection_page_link( $previous_page, array( 'registration_status' => true ) ) ),
'redirect_message' => esc_html( 'Registration completed. Please check your email for confirmation. You will be redirected...', 'directorist' ),
);
wp_send_json( $response );
wp_send_json_success( $response );
} else {
file_put_contents( __DIR__ . '/data.txt', 'status' );
$response = array(
'success' => true,
'redirect_url' => esc_url_raw( ATBDP_Permalink::get_dashboard_page_link( array( 'registration_status' => true ) ) ),
'redirect_message' => esc_html( 'Registration completed. Please check your email for confirmation. You will be redirected...', 'directorist' ),
);
wp_send_json( $response );
wp_send_json_success( $response );
}

exit();
Expand All @@ -248,7 +248,7 @@ public function directorist_register_form() {
'success' => false,
'message' => directorist_get_registration_error_message( 0 )
);
wp_send_json( $response );
wp_send_json_success( $response );
exit();
}
}
Expand Down