svn commit: r1147143 - /ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1147143 - /ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java

mor-2
Author: mor
Date: Fri Jul 15 13:30:32 2011
New Revision: 1147143

URL: http://svn.apache.org/viewvc?rev=1147143&view=rev
Log:
Minor mods to ShoppingCart.clear() method to allow system to clear the list for anonymous user.

Modified:
    ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java

Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java?rev=1147143&r1=1147142&r2=1147143&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java Fri Jul 15 13:30:32 2011
@@ -1361,7 +1361,6 @@ public class ShoppingCart implements Ite
         this.readOnlyCart = false;
 
         this.lastListRestore = null;
-        this.autoSaveListId = null;
 
         this.orderTermSet = false;
         this.orderTerms.clear();
@@ -1396,7 +1395,10 @@ public class ShoppingCart implements Ite
             if (ul == null) {
                 ul = this.getAutoUserLogin();
             }
-
+            // autoSaveListId shouldn't be set to null for anonymous user until the list is not cleared from the database
+            if (ul != null && !"anonymous".equals(ul.getString("userLoginId"))) {
+                this.autoSaveListId = null;
+            }
             // load the auto-save list ID
             if (autoSaveListId == null) {
                 try {