Fixed problem when session has a cart ID but the reg_request record doesn't exist.
authorChuck Scott <cscott@gaslightmedia.com>
Tue, 19 Dec 2017 13:46:30 +0000 (08:46 -0500)
committerChuck Scott <cscott@gaslightmedia.com>
Tue, 19 Dec 2017 13:46:30 +0000 (08:46 -0500)
classes/regCartSupport.php

index fa61942..7a2aecc 100644 (file)
@@ -334,15 +334,18 @@ class GlmRegCartSupport
      */
     public function checkRegistrationRequest($requestId = false, $json = false, $noReturn = false)
     {
-
+        
+        // echo "SESSION DATA: <pre>".print_r($_SESSION,1).print_r($regRequest,1)."</pre>";
+        
         // Try to get the cart data
         $this->getRegistrationCart($requestId, false, true);
 
         $this->cart['blockCheckout'] = false;
 
-        // If cart status is false, then we don't have a cart so return now
+        // If cart status is false, then we don't have a cart so block checkout, clear cart ID, and return
         if (!$this->cart['status']) {
             $this->cart['blockCheckout'] = true;
+            $_SESSION['glm_reg_cart_id'] = false;
             return $this->cart;
         }
 
@@ -736,8 +739,6 @@ class GlmRegCartSupport
             return false;
         }
 
-        // echo "<pre>".print_r($_SESSION,1).print_r($regRequest,1)."</pre>";
-
         // If there's a logged in registrations user (overrides any WordPress adminstrator or contact logins
         if (isset($_SESSION) && isset($_SESSION['LoginAccount']) && is_array($_SESSION['LoginAccount'])) {