WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. Sebastien Dumont
    Member
    Posted 8 months 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.

    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.

    http://wordpress.org/plugins/woocommerce/

  2. arggasasao
    Member
    Posted 2 months ago #

    I have the same problem.
    Help please

    tks

Reply

You must log in to post.

About this Plugin

About this Topic