Author: jonesde
Date: Tue Nov 21 13:20:25 2006
New Revision: 477896
URL:
http://svn.apache.org/viewvc?view=rev&rev=477896Log:
Fixed bugs reported by Ashish Vijaywargiya in Jira #OFBIZ-480; is based on Vijay's patch, but used a different fix for the showcart page so that it creates a cart if there isn't one in the session
Modified:
incubator/ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/cart/showcart.bsh
incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java
Modified: incubator/ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/cart/showcart.bsh
URL:
http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/cart/showcart.bsh?view=diff&rev=477896&r1=477895&r2=477896==============================================================================
--- incubator/ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/cart/showcart.bsh (original)
+++ incubator/ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/cart/showcart.bsh Tue Nov 21 13:20:25 2006
@@ -1,5 +1,4 @@
/*
- *
* Copyright 2001-2006 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
@@ -18,13 +17,14 @@
import org.ofbiz.base.util.UtilMisc;
import org.ofbiz.product.catalog.CatalogWorker;
import org.ofbiz.order.shoppingcart.product.ProductDisplayWorker;
+import org.ofbiz.order.shoppingcart.ShoppingCartEvents;
import org.ofbiz.entity.condition.*;
delegator = request.getAttribute("delegator");
userLogin = session.getAttribute("userLogin");
// Get the Cart and Prepare Size
-shoppingCart = session.getAttribute("shoppingCart");
+shoppingCart = ShoppingCartEvents.getCartObject(request);
if (shoppingCart != null) {
context.put("shoppingCartSize", shoppingCart.size());
} else {
Modified: incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java
URL:
http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java?view=diff&rev=477896&r1=477895&r2=477896==============================================================================
--- incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java (original)
+++ incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java Tue Nov 21 13:20:25 2006
@@ -609,7 +609,7 @@
// if this was an anonymous checkout process, go ahead and clear the session and such now that the order is placed; we don't want this to mess up additional orders and such
HttpSession session = request.getSession();
GenericValue userLogin = (GenericValue) session.getAttribute("userLogin");
- if ("anonymous".equals(userLogin.get("userLoginId"))) {
+ if (userLogin != null && "anonymous".equals(userLogin.get("userLoginId"))) {
// here we want to do a full logout, but not using the normal logout stuff because it saves things in the UserLogin record that we don't want changed for the anonymous user
session.invalidate();
session = request.getSession(true);