Forum Replies Created

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)