Hi, i managed to direct user who login via email to homepage. however, if the user login via facebook, it will still go to the my account page. Can you help me with it?
function ts_redirect_login( $redirect ) {
$redirect_page_id = url_to_postid( $redirect );
$checkout_page_id = wc_get_page_id( ‘checkout’ );
if( $redirect_page_id == $checkout_page_id ) {
return $redirect;
}
return wc_get_page_permalink( ‘/’ );
}
add_filter( ‘woocommerce_login_redirect’, ‘ts_redirect_login’ );