Fixing the bug in the get cart method when not logged in.
authorSteve Sutton <steve@gaslightmedia.com>
Thu, 2 Nov 2017 15:32:20 +0000 (11:32 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Thu, 2 Nov 2017 15:32:20 +0000 (11:32 -0400)
If not logged in there may not be session loggin variable so need to
check for not isset first.

classes/regCartSupport.php

index 760c755..211849c 100644 (file)
@@ -723,7 +723,7 @@ class GlmRegCartSupport
             }
 
             // If it's a guest account and the request ID is in the current session - allow cart
-            if ( isset( $_SESSION['LoginAccount'] ) && $_SESSION['LoginAccount']['id'] == 0 && $_SESSION['glm_reg_cart_id'] == $requestId) {
+            if ( !isset( $_SESSION['LoginAccount'] ) || isset( $_SESSION['LoginAccount'] ) && $_SESSION['LoginAccount']['id'] == 0 && $_SESSION['glm_reg_cart_id'] == $requestId) {
                 return true;
             }