• Thanks for the great plugin.

    Instead of
    wp_redirect( get_bloginfo( ‘home’ ) );

    I’m trying to redirect to the my-accout page with the hook “woocommerce_after_my_account”

    Any idea how I tie it all together? I can’t seem to get it right.

    Thanks in advance

    https://wordpress.org/plugins/groups/

Viewing 1 replies (of 1 total)
  • Thread Starter adieu man

    (@adieu-man)

    Found it, tested it and it works. Hides shop and redirects to my account if not logged in.

    if ( class_exists( ‘Groups_User’ ) ) {
    $redirect = true;
    if ( $user_id = get_current_user_id() ) {
    $user = new Groups_User( $user_id );
    if ( $user->can( ‘groups_read_post’ ) ) {
    $redirect = false;
    }
    }
    if ( $redirect ) {
    wp_redirect( $myaccount_page_id( ‘woocommerce_myaccount_page_id’ ) );
    }
    }

Viewing 1 replies (of 1 total)
  • The topic ‘redirect to my-account’ is closed to new replies.