If no account found for front end renewal form give message.
authorSteve Sutton <steve@gaslightmedia.com>
Thu, 5 Apr 2018 12:07:38 +0000 (08:07 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Thu, 5 Apr 2018 12:07:38 +0000 (08:07 -0400)
Give a message that you must be logged in with member account.

models/front/billing/renew.php
views/front/billing/noaccount.html [new file with mode: 0644]

index b286c02..bf8e9cd 100644 (file)
@@ -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 (file)
index 0000000..651f5b4
--- /dev/null
@@ -0,0 +1,2 @@
+<h2>No account found!</h2>
+<p>You must be logged in as a member.</p>