Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author taisho

    (@taisho)

    The link that you posted is very far from what you want to achieve, but here is a snippet you can use in functions.php. It will change the redirect link used by Extra Settings for WooCommerce to shop link for active subscribers:

    add_action( 'template_redirect', 'taisho_active_subscriptions', 999 );
    function taisho_active_subscriptions () {
    	add_filter( 'woocommerce_login_redirect', 'taisho_active_subscriber_user_redirect', 1000, 2 );
    }
    function taisho_active_subscriber_user_redirect( $redirect, $user ) {
    	if ( wcs_user_has_subscription( '', '', 'active' ) ) {
    		$shop_page_url = get_permalink( wc_get_page_id( 'shop' ) );
    		$redirect = $shop_page_url;
    	}
    	return $redirect;
    }
    Thread Starter deyson

    (@deyson)

    Thank you ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Compatible with redirect User Role Code’ is closed to new replies.