Redirect after login/register in plugin Ajax Login/Register for WooCommerce

Redirect customer to any custom page after login/register. Just use below snippet by using this snippet you can redirect to customer homepage. You just need to modify this snippet if you want to redirect to any other page.

Snippet for login redirect

/*
* plugin : Ajax Login/Register for WooCommerce
* redirect to custom page after login
* refer : https://www.zorem.com/redirect-after-login-register-in-plugin-ajax-login-register-for-woocommerce/ 
*/
add_filter( "wcalr_login_redirect", "wcalr_login_redirect_link", 10, 1);
function wcalr_login_redirect_link($link){
	$link = get_home_url();
	return $link;
}

Snippet for registration redirect

/*
* plugin : Ajax Login/Register for WooCommerce
* redirect to custom page after register
* refer : https://www.zorem.com/redirect-after-login-register-in-plugin-ajax-login-register-for-woocommerce/
*/
add_filter( "wcalr_register_redirect", "wcalr_register_redirect_link", 10, 1);
function wcalr_register_redirect_link($link){
	$link = get_home_url();
	return $link;
}

Leave a Reply

Your email address will not be published. Required fields are marked *