Blank page returns on woocommerce registration redirect filtered
-
I am adding the registration form on the product page for those who are logged out. I have filtered the redirection but I get a blank page in return.
I am working on my modifications on my computer as localhost.
Could this be the reason why or is their something wrong with my code.
If anyone can help me, I would appreciate it very much.
Thank you.
if(!function_exists('product_registration_redirect')){ /** * Filters the registration form if the * user registers on a single product page. */ function product_registration_redirect($redirect){ global $post, $woocommerce; $page = (int) $_POST['redirect_after']; if( is_product() ){ if(isset($page) && $page != ''){ $redirect = esc_url( add_query_arg( 'action', 'registered', get_permalink($page) ) ); } else{ $redirect = esc_url( get_permalink( woocommerce_get_page_id('myaccount') ) ); } return $redirect; } } } add_filter('woocommerce_registration_redirect', 'product_registration_redirect'); // Redirect back to the product page after registration on product page.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Blank page returns on woocommerce registration redirect filtered’ is closed to new replies.