Subscriptions Error Message

This topic contains 2 reply and 2 voices, and was last updated by Tareq Hasan 10 years, 10 months ago
Viewing 2 Posts - 1 through 2 (of 2 total)
Author Posts
May 27, 2013 at 2:34 pm 4243
Tareq Hasan 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.
May 27, 2013 at 2:49 pm 4244
tobyleftly tobyleftly

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.

May 28, 2013 at 2:08 am 4256
Tareq Hasan Tareq Hasan

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