Home Forums Plugin Support WP User Frontend Pro Subscriptions Error Message

This topic is: resolved

This topic contains 2 replies, has 2 voices, and was last updated by  Tareq Hasan 5 years, 12 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #4243

    tobyleftly
    Participant
    Post count: 12

    Hi there

    I set up wp users frontend pro and it was working, but now when I try to signup as a new user and visit the subscriptions page, I see this error:

    Your subscription as an ACWR member is currently active:

    Notice: Trying to get property of non-object in /Applications/MAMP/apache2/htdocs/wp-content/plugins/wp-user-frontend-pro/class/subscription.php on line 268

    I've created new member roles and assigned one of the new roles to the registration form being used, otherwise nothing else has changed.

    #4244

    tobyleftly
    Participant
    Post count: 12

    Sorry, I should have said.. I have an if-loop on this page which echoes either subscription info or the subscription packs depending upon whether the user has paid already:

    <?php
    if ( is_user_logged_in() && WPUF_Subscription::has_user_error() ) { ?>
    <p>You do not have a valid ACWR subscription, please select a package below:</p>
    <div class="sub-choice-box">
    	<?php echo do_shortcode('[wpuf_sub_pack]') ?>
    </div>
    <?php } else { ?>
    <p>Your subscription as an ACWR member is currently active:</p>
    <?php echo do_shortcode('[wpuf_sub_info]') ?>
    <?php } ?>

    This was working previously.

    Thanks.

    #4256

    Tareq Hasan
    Keymaster
    Post count: 2831

    I think the problem occurs when the user is not logged in, so you need to add another check

    [php]
    if ( is_user_logged_in() && WPUF_Subscription::has_user_error() ) {

    echo do_shortcode(‘[wpuf_sub_pack]');

    } elseif ( is_user_logged_in() ) {

    echo do_shortcode(‘[wpuf_sub_info]');

    } else {
    // you are not logged in
    }
    [/php]

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

The topic ‘Subscriptions Error Message’ is closed to new replies.