WooCommerce - excelling eCommerce
Blank page returns on woocommerce registration redirect filtered (2 posts)

  1. Sebastien D
    Posted 1 year ago #

    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.

    	 * 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) ) );
    				$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.


  2. arggasasao
    Posted 1 year ago #

    I have the same problem.
    Help please


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WooCommerce - excelling eCommerce
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic