From e49d452398ea17d06dffd9abbeaff99feef8493d Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Thu, 5 Apr 2018 08:07:38 -0400 Subject: [PATCH] If no account found for front end renewal form give message. Give a message that you must be logged in with member account. --- models/front/billing/renew.php | 6 ++++-- views/front/billing/noaccount.html | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 views/front/billing/noaccount.html diff --git a/models/front/billing/renew.php b/models/front/billing/renew.php index b286c02..bf8e9cd 100644 --- a/models/front/billing/renew.php +++ b/models/front/billing/renew.php @@ -129,8 +129,7 @@ class GlmMembersFront_billing_renew // extends GlmDataBilling ) { $this->memberID = $this->config['loggedInUser']['contactUser']['ref_dest']; } else { - // throw an error - wp_die('Not finding any account for you!'); + $option = 'noaccount'; } // Check if there's a logged in user who is locked to their own entity. @@ -173,6 +172,9 @@ class GlmMembersFront_billing_renew // extends GlmDataBilling $account_status = apply_filters( 'glm-billing-get-account-status', '', $accountID ); switch ( $option ) { + case 'noaccount': + $view = 'noaccount'; + break; case 'renew': // TODO: only the renew form if the member is not active if ( $account_status == 'Active' ) { diff --git a/views/front/billing/noaccount.html b/views/front/billing/noaccount.html new file mode 100644 index 0000000..651f5b4 --- /dev/null +++ b/views/front/billing/noaccount.html @@ -0,0 +1,2 @@ +

No account found!

+

You must be logged in as a member.

-- 2.17.1