Home Forums Plugin Support WP User Frontend Pro If user has paid, then..

This topic is: resolved

Tagged: ,

This topic contains 5 replies, has 3 voices, and was last updated by  paperweight 6 years, 1 month ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #2462

    tobyleftly
    Participant
    Post count: 12

    Hi there

    The plugin is extremely solid and is simple and powerful compared to similar ones I've tried.. many thanks.

    I'm trying to find a way to display a box on every page in a certain section of a site for users who have signed up but not provided payment yet.. I'm sure I saw that you had written on the forum about how to check if a user has paid or not, but I can't seem to find the post.

    Any help greatly appreciated!

    #2466

    Tareq Hasan
    Keymaster
    Post count: 2831

    May be this would help –
    [php]
    if ( class_exists( ‘WPUF_Subscription' ) ) {
    if ( is_user_logged_in() && WPUF_Subscription::has_user_error() ) {
    // user don't have a active subscription
    // show some message
    }
    }
    [/php]

    #2471

    tobyleftly
    Participant
    Post count: 12

    Hey.. many thanks for the prompt response – this seems to throw a PHP error for the first ‘ { ‘ on the first line.. do I need that first ‘if' statement? It looks like it's just checking for the plugin..

    Thanks again.

    #2474

    Tareq Hasan
    Keymaster
    Post count: 2831

    I fixed that right after I posted the code. Yeah, may be you don't need that check, just a precaution that you don't get a fatal error.

    #2476

    tobyleftly
    Participant
    Post count: 12

    perfect.. works like a charm!

    #3422

    paperweight
    Participant
    Post count: 122

    And just to expand this a little with if/else, you can use this to show things:

    
    if ( class_exists( 'WPUF_Subscription' ) ) {
        if ( is_user_logged_in() && WPUF_Subscription::has_user_error() ) {
        echo 'TEXT TO SHOW IF USER HAS NOT PAID YET';
    } else {
        echo 'TEXT TO SHOW IF USER HAS PAID FOR IT';
        }
    }

    Wrap the above in pphp start/end tags too.

Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘If user has paid, then..’ is closed to new replies.