If user has paid, then..

This topic contains 5 reply and 3 voices, and was last updated by paperweight 10 years, 11 months ago
Viewing 5 Posts - 1 through 5 (of 5 total)
Author Posts
April 18, 2013 at 1:36 pm 2462
paperweight 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!
April 18, 2013 at 2:08 pm 2466
Tareq Hasan Tareq Hasan

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]

April 18, 2013 at 3:00 pm 2471
tobyleftly tobyleftly

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.

April 18, 2013 at 3:08 pm 2474
Tareq Hasan Tareq Hasan

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.

April 18, 2013 at 3:10 pm 2476
tobyleftly tobyleftly

perfect.. works like a charm!

May 9, 2013 at 2:40 pm 3422
paperweight paperweight

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 5 Posts - 1 through 5 (of 5 total)