diff --git a/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java b/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java index a031867695..558f34f26f 100644 --- a/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java +++ b/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java @@ -3246,16 +3246,11 @@ public class ShoppingCart implements Iterable, Serializable { } } - public String addProductPromoCode(String productPromoCodeId, LocalDispatcher dispatcher) { - return this.addProductPromoCode(productPromoCodeId, null, dispatcher); - } - /** Adds a promotion code to the cart, checking if it is valid. If it is valid this will return null, otherwise it will return a message stating why it was not valid * @param productPromoCodeId The promotion code to check and add - * @param cart Shopping Cart Object * @return String that is null if valid, and added to cart, or an error message of the code was not valid and not added to the cart. */ - public String addProductPromoCode(String productPromoCodeId, ShoppingCart cart, LocalDispatcher dispatcher) { + public String addProductPromoCode(String productPromoCodeId, LocalDispatcher dispatcher) { if (this.productPromoCodes.contains(productPromoCodeId)) { return UtilProperties.getMessage(resource_error, "productpromoworker.promotion_code_already_been_entered", UtilMisc.toMap("productPromoCodeId", productPromoCodeId), locale); } @@ -3264,7 +3259,7 @@ public class ShoppingCart implements Iterable, Serializable { return null; } // if the promo code requires it make sure the code is valid - String checkResult = ProductPromoWorker.checkCanUsePromoCode(productPromoCodeId, this.getPartyId(), this.getDelegator(), cart, locale); + String checkResult = ProductPromoWorker.checkCanUsePromoCode(productPromoCodeId, this.getPartyId(), this.getDelegator(), this, locale); if (checkResult == null) { this.productPromoCodes.add(productPromoCodeId); // new promo code, re-evaluate promos diff --git a/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java b/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java index dd4dd9d0ea..5b7e9b062d 100644 --- a/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java +++ b/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java @@ -85,7 +85,7 @@ public class ShoppingCartEvents { ShoppingCart cart = getCartObject(request); String productPromoCodeId = request.getParameter("productPromoCodeId"); if (UtilValidate.isNotEmpty(productPromoCodeId)) { - String checkResult = cart.addProductPromoCode(productPromoCodeId, cart, dispatcher); + String checkResult = cart.addProductPromoCode(productPromoCodeId, dispatcher); if (UtilValidate.isNotEmpty(checkResult)) { request.setAttribute("_ERROR_MESSAGE_", checkResult); return "error";