Checkout redirect does not include query params

[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.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer