Author: pawan
Date: Sat Jul 27 06:22:01 2019 New Revision: 1863837 URL: http://svn.apache.org/viewvc?rev=1863837&view=rev Log: [Improved]: Code improvement in ShoppingCartEvents.java [OFBIZ-11127] Method 'getCartObject' and 'destroyCart'of ShoppingCartEvents class accessed incorrectly at some places in ShoppingCartEvents class. It should be called by following below syntax: getCartObject(parameters); destroyCart(request, response); Thanks Amit Gadaley for your contribution. Modified: ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartEvents.java Modified: ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartEvents.java URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartEvents.java?rev=1863837&r1=1863836&r2=1863837&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartEvents.java (original) +++ ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartEvents.java Sat Jul 27 06:22:01 2019 @@ -1564,7 +1564,7 @@ public class ShoppingCartEvents { } request.setAttribute("quoteId", quoteId); if (destroyCart != null && "Y".equals(destroyCart)) { - ShoppingCartEvents.destroyCart(request, response); + destroyCart(request, response); } return "success"; @@ -1596,7 +1596,7 @@ public class ShoppingCartEvents { } request.setAttribute("custRequestId", custRequestId); if (destroyCart != null && "Y".equals(destroyCart)) { - ShoppingCartEvents.destroyCart(request, response); + destroyCart(request, response); } return "success"; @@ -1659,7 +1659,7 @@ public class ShoppingCartEvents { } if (hasPermission) { - cart = ShoppingCartEvents.getCartObject(request, null, productStore.getString("defaultCurrencyUomId")); + cart = getCartObject(request, null, productStore.getString("defaultCurrencyUomId")); } else { request.setAttribute("_ERROR_MESSAGE_", UtilProperties.getMessage(resource_error,"OrderYouDoNotHavePermissionToTakeOrdersForThisStore", locale)); cart.clear(); @@ -1790,7 +1790,7 @@ public class ShoppingCartEvents { public static String bulkAddProducts(HttpServletRequest request, HttpServletResponse response) { Delegator delegator = (Delegator) request.getAttribute("delegator"); LocalDispatcher dispatcher = (LocalDispatcher) request.getAttribute("dispatcher"); - ShoppingCart cart = ShoppingCartEvents.getCartObject(request); + ShoppingCart cart = getCartObject(request); ShoppingCartHelper cartHelper = new ShoppingCartHelper(delegator, dispatcher, cart); String controlDirective = null; Map<String, Object> result = null; @@ -2006,7 +2006,7 @@ public class ShoppingCartEvents { Delegator delegator = (Delegator) request.getAttribute("delegator"); String productId = request.getParameter("product_id"); - String currencyUomId = ShoppingCartEvents.getCartObject(request).getCurrency(); + String currencyUomId = getCartObject(request).getCurrency(); ProductConfigWrapper configWrapper = ProductConfigWorker.getProductConfigWrapper(productId, currencyUomId, request); if (configWrapper == null) { Debug.logWarning("configWrapper is null", module); @@ -2119,7 +2119,7 @@ public class ShoppingCartEvents { return "error"; } request.setAttribute("shoppingCart", result.get("shoppingCart")); - ShoppingCartEvents.destroyCart(request, response); + destroyCart(request, response); } catch (GenericServiceException e) { Debug.logError(e, "Failed to execute service appendOrderItem", module); request.setAttribute("_ERROR_MESSAGE_", e.getMessage()); |
Free forum by Nabble | Edit this page |