[ad_1]
I created a temporary solution but it is still ideal to put it in the plugin or at least something similar.
Solution:
1. Replace
add_filter( ‘woocommerce_registration_redirect’, [ $this, ‘redirect_to_checkout’ ], 100 );
to
add_filter( ‘woocommerce_registration_redirect’, [ $this, ‘redirect_to_checkout_no_autologin’ ], 100 );
### defition of the function ###
# Custom function to allow no-autologin
public function redirect_to_checkout_no_autologin ( $redirect ) {
if ( $this->has_query_param() ) {
$url = get_permalink( get_option(‘woocommerce_myaccount_page_id’) );
$url_with_param = add_query_arg( array(
self::URL_ARG => ”,
‘approved’ => ‘false’
)
, $url );
$redirect = $url_with_param;
#expected behaviour is
}
return $redirect;
}
marking this as resolved.
